JMS element

IBMStreams com.ibm.streamsx.messaging Toolkit > com.ibm.streamsx.messaging 5.4.3 > Connection specifications document > Connection_specification element > JMS element

The <JMS> element specifies the information that is needed by the JMSSink and JMSSource operators to establish a connection to messaging system.

The following example shows connection specification that contains a <JMS> element:

<connection_specifications>
  <connection_specification name="amqConn">
    <JMS initial_context="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
    provider_url = "tcp://machinename.com:61616"
    connection_factory = "ConnectionFactory"
    user="user1"
    password="password1"/>
  </connection_specification>
</connection_specifications>
The <JMS> element has the following attributes:
  • connection_factory
    • This mandatory attribute value is the name of the ConnectionFactory administered object. This administered object is within the directory service context that is specified by the initial_context attribute, and it is used to establish the connection. For applications that use Apache ActiveMQ, you can use the default administered object called ConnectionFactory.
  • initial_context
    • This mandatory attribute represents the class name of the factory class that creates an initial context. The following example shows the initial_context when the messaging provider is WebSphere MQ and it uses the .bindings file: com.sun.jndi.fscontext.RefFSContextFactory
    • The following example shows the initial_context when the messaging provider is Apache ActiveMQ: org.apache.activemq.jndi.ActiveMQInitialContextFactory
  • password
    • The password attribute contains the authentication credentials (password) for the user ID. This attribute is optional.
  • provider_url
    • This mandatory attribute is a URL that points to the directory service that contains the administered objects or the JNDI URL that stores the objects in the file system. The syntax of the URL varies based on the messaging provider.
      • file:///homes/abc/xyz/wef: Use this format if your application sends data to or receive messages from a WebSphere MQ queue or topic. This format specifies that the administered objects are stored in a file called .bindings, which is in the /homes/abc/xyz/wef directory.
      • file:abc/xyz/wef: Use this format if your application sends data to or receive messages from a WebSphere MQ queue or topic. This format specifies that the administered objects are stored in a file called .bindings, which is in the abc/xyz/wef directory relative to the application directory.
      • tcp://machinename.com:61616: Use this format if your application sends data to or receives messages from Apache ActiveMQ.
  • user
    • The value of the user attribute provides the user identification under which the connection to the messaging provider is attempted. This attribute is optional.