Introduction

JMSFragment

JMSFragment supports the following attributes: 

AttributeUsageDescription
client_idOptional

The client identifier for this connection.

See: Connection.setClientID

destinationOptional

A Destination object encapsulates a provider-specific address.

Possible values:

  • Queue
  • Topic.

See: Destination


Default: Queue

destination_nameDependentThe name of either the destination queue or topic according to the setting made for the destination attribute.
acknowledge_modeOptional

Session acknowledgment mode.

Possible values: 

  • Session.AUTO_ACKNOWLEDGE
  • Session.CLIENT_ACKNOWLEDGE
  • Session.AUTO_ACKNOWLEDGE

See: Session


Default: Session.CLIENT_ACKNOWLEDGE

delivery_modeOptional

Delivery mode.

Possible values: 

  • DeliveryMode.NON_PERSISTENT
  • DeliveryMode.PERSISTENT

See:


Default: DeliveryMode.PERSISTENT

priorityOptional

The producer's default priority.

See: MessageProducer.setPriority


Default: 4

time_to_liveOptional

Sets the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.

See: MessageProducer.setTimeToLive

Possible values:

  • <n> - duration in milliseconds
    • e.g.: 60000
  • <n>s - duration in seconds
    • e.g.: 30s
  • <n>m - duration in minutes
    • e.g.: 30m
  • <n>h - duration in hours
    • e.g.: 24h
  • <n>d - duration in days
    • e.g.: 30d
  • <n>w - duration in weeks
    • e.g.: 4w
  • Combined values (with blank space as separator):
    • e.g.: 1w 1d 1h

Default: 0


One of the following elements must be available inside a JMSFragment element:

ElementElement descriptionDescription
ConnectionFactoryOptional or only once inside the JMSFragment elementSpecifies use of a JMS ConnectionFactory implementation
ConnectionJNDIOptional or only once inside the JMSFragment elementSpecifies use of a JNDI properties file to create a JNDI InitialContextFactory


JMS message:

ElementElement descriptionDescription
MessageRequired, only once inside of JMSFragment elementBody of a JMS notification

ConnectionFactory

Specifies use of a JMS ConnectionFactory implementation.

ConnectionFactory supports the following attributes:  

AttributeUsageDescription
java_classRequired

Java class of the JMS ConnectionFactory

e.g.: org.apache.activemq.ActiveMQConnectionFactory

user_nameOptionalThe caller's user name
passwordOptionalThe caller's password


The following element can be nested inside a ConnectionFactory element:

ElementElement descriptionDescription
ConstructorArgumentsOptional or only once inside of ConnectionFactory element  

 ConstructorArguments

The following elements can be nested inside a ConstructorArguments element:

ElementElement descriptionDescription
ArgumentRequired, repeated use allowed inside the ConstructorArguments element  JMS ConnectionFactory constructor argument

 

Example: ActiveMQConnectionFactory with 1 constructor argument
...
<ConnectionFactory java_class="org.apache.activemq.ActiveMQConnectionFactory">
    <ConstructorArguments>
        <Argument type="java.lang.String"><![CDATA[tcp://localhost:61616]]></Argument>
    </ConstructorArguments>
</ConnectionFactory>
...

 

Example: ActiveMQConnectionFactory with 3 constructor arguments
...
<ConnectionFactory java_class="org.apache.activemq.ActiveMQConnectionFactory">
    <ConstructorArguments>
        <Argument type="java.lang.String"><![CDATA[my_user_name]]></Argument>
        <Argument type="java.lang.String"><![CDATA[my_password]]></Argument>
        <Argument type="java.lang.String"><![CDATA[tcp://localhost:61616]]></Argument>
    </ConstructorArguments>
</ConnectionFactory>
...

 Argument

 Argument supports the following attributes: 

Attribute

Usage

Description

typeRequired

Java type of a constructor argument.

Possible values:

  • boolean
  • double
  • float
  • int
  • long
  • short
  • java.lang.Boolean
  • java.lang.Double
  • java.lang.Float
  • java.lang.Integer
  • java.lang.Long
  • java.lang.Short
  • java.lang.String


Default: java.lang.String

The value of the constructor argument will be stored as CDATA node.

Example
...
<Argument type="java.lang.String"><![CDATA[tcp://localhost:61616]]></Argument>
...

ConnectionJNDI

Specifies use of a JNDI properties file to create a JNDI InitialContextFactory.

See: Connecting to the JMS Server by Using JNDI

ConnectionJNDI supports the following attributes:  

AttributeUsageDescription
fileRequiredPath of the JNDI properties file
lookup_nameOptional

Name to lookup JMS connection factory objects


Default: ConnectionFactory

 

Example: content of the JNDI properties file for ActiveMQ
java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
java.naming.provider.url=tcp://localhost:61616 

Message

Body of a JMS notification. Any JS7 - Notification - Configuration, Monitor Variables can be used with the body.

Example for Apache ActiveMQ

Configuration

For use with Apache ActiveMQ a JMSFragment configuration can look like this:

Example: JMSFragment Configuration
<JMSFragment acknowledge_mode="Session.CLIENT_ACKNOWLEDGE" delivery_mode="DeliveryMode.PERSISTENT" destination="Queue" destination_name="js7" name="js7_on_failure" priority="4" time_to_live="0">
    <MessageRef ref="command_on_failure"/>
    <ConnectionFactory java_class="org.apache.activemq.ActiveMQConnectionFactory" password="admin" user_name="admin">
        <ConstructorArguments>
            <Argument type="java.lang.String"><![CDATA[tcp://activemq-5-15:61616]]></Argument>
        </ConstructorArguments>
    </ConnectionFactory>
</JMSFragment>

Client Libraries

The JS7 does not ship with client libraries for specific JMS server products such as Apache ActiveMQ, Apache Kafka and others.

Instead, users have to provide a version of the libraries that match their JMS server product. 



  • No labels