Configuration for outbound communication

 

When using outbound communication, an application running in an application server starts a connection to a queue manager, and then sends messages to its queues and receives messages from its queues in a synchronous manner. For example, the following servlet method, doGet(), uses outbound communication:

protected void doGet(HttpServletRequest request, HttpServletResponse response)
     throws ServletException, IOException {

...

// Look up ConnectionFactory and Queue objects from the JNDI namespace

     InitialContext ic = new InitialContext();
     ConnectionFactory cf = (javax.jms.ConnectionFactory) ic.lookup("myCF");
     Queue q = (javax.jms.Queue) ic.lookup("myQueue");

// Create and start a connection

     Connection c = cf.createConnection();
     c.start();

// Create a session and message producer

     Session s = c.createSession(false, Session.AUTO_ACKNOWLEDGE);
     MessageProducer pr = s.createProducer(q);

// Create and send a message

     Message m = s.createTextMessage("Hello, World!");
     pr.send(m);

// Create a message consumer and receive the message just sent

     MessageConsumer co = s.createConsumer(q);
     Message mr = co.receive(5000);

// Close the connection

      c.close();
}
When the servlet receives an HTTP GET request, it retrieves a ConnectionFactory object and a Queue object from the JNDI namespace, and uses the objects to send a message to a WebSphere MQ queue. The servlet then receives the message that it has just sent.

To configure outbound communication, define JCA resources in the following categories:

The way you define these properties depends on the administration interfaces provided by your application server. ConnectionFactory, Queue, and Topic objects created by the application server are bound into a JNDI namespace from where they can be retrieved by an application.

Typically, you define one ConnectionFactory object for each queue manager that applications might need to connect to, one Queue object for each queue that applications might need to access in the point-to-point domain, and one Topic object for each topic that applications might want to publish or subscribe to. A ConnectionFactory object can be domain independent. Alternatively, it can be domain specific, a QueueConnectionFactory object for the point-to-point domain or a TopicConnectionFactory object for the publish/subscribe domain.

Table 1 lists the properties of a ConnectionFactory object.

Properties of a ConnectionFactory object
Name of property Type Valid values (default value in bold) Description
brokerCCSubQueue String

  • SYSTEM.JMS.ND.CC.SUBSCRIBER.QUEUE

  • A queue name

The name of the queue from which a connection consumer receives nondurable subscription messages
brokerControlQueue String

The name of the broker control queue
brokerPubQueue String

The name of the queue where published messages are sent (the stream queue)
brokerQueueManager String

  • "" (empty string)

  • A queue manager name

The name of the queue manager on which the broker is running
brokerSubQueue String

  • SYSTEM.JMS.ND.SUBSCRIBER.QUEUE

  • A queue name

The name of the queue from which a nondurable message consumer receives messages
brokerVersion String

  • 1

  • 2

The version of the broker being used
ccdtURL String

  • null

  • A uniform resource locator (URL)

A URL that identifies the name and location of the file containing the client channel definition table and specifies how the file can be accessed
CCSID String

  • 819

  • A coded character set identifier supported by the Java virtual machine (JVM)

The coded character set identifier for a connection
channel String

  • SYSTEM.DEF.SVRCONN

  • The name of an MQI channel

The name of the MQI channel to use
cleanupInterval int

  • 3 600 000

  • A positive integer

The interval, in milliseconds, between background runs of the publish/subscribe cleanup utility
cleanupLevel String

  • SAFE

  • NONE

  • STRONG

  • FORCE

  • NONDUR

The cleanup level for a broker based subscription store
clientID String

  • null

  • A client identifier

The client identifier for a connection
failIfQuiesce boolean

  • true

  • false

Whether calls to certain methods fail if the queue manager is in a quiescing state
hostName String

  • localhost

  • A host name

  • An IP address

The host name or IP address of the system on which the queue manager resides
localAddress String

  • null

  • A string in the format:
    [host_name][(low_port[,high_port])]
    where host_name is a host name or IP address, low_port and high_port are TCP port numbers, and brackets denote an optional component

For a connection to a queue manager, this property specifies either or both of the following:

  • The local network interface to be used

  • The local port, or range of local ports, to be used

messageSelection String

  • CLIENT

  • BROKER

Determines whether message selection is done by WebSphere MQ JMS or by the broker. Message selection by the broker is not supported when brokerVhas the value 1.
password String

  • null

  • A password

The default password to use when creating a connection to the queue manager
port int

  • 1414

  • A TCP port number

The port on which the queue manager listens
pubAckInterval int

  • 25

  • A positive integer

The number of messages published by a publisher before WebSphere MQ JMS requests an acknowledgement from the broker.
queueManager String

  • "" (empty string)

  • A queue manager name

The name of the queue manager to connect to
receiveExit String

  • null

  • A string comprising one or more items separated by commas, where each item is the fully qualified name of a class that implements the WebSphere MQ base Java interface, MQReceiveExit

Identifies a channel receive exit program, or a sequence of receive exit programs to be run in succession
receiveExitInit String

  • null

  • A string comprising one or more items of user data separated by commas

The user data that is passed to channel receive exit programs when they are called
securityExit String

  • null

  • The fully qualified name of a class that implements the WebSphere MQ base Java interface, MQSecurityExit

Identifies a channel security exit program
securityExitInit String

  • null

  • A string of user data

The user data that is passed to a channel security exit program when it is called
sendExit String

  • null

  • A string comprising one or more items separated by commas, where each item is the fully qualified name of a class that implements the WebSphere MQ base Java interface, MQSendExit

Identifies a channel send exit program, or a sequence of send exit programs to be run in succession
sendExitInit String

  • null

  • A string comprising one or more items of user data separated by commas

The user data that is passed to channel send exit programs when they are called
sslCertStores String

  • null

  • A string of one or more LDAP URLs separated by blanks. Each LDAP URL has the format:
    ldap://host_name[:port]
    where host_name is a host name or IP address, port is a TCP port number, and brackets denote an optional component.

The Lightweight Directory Access Protocol (LDAP) servers that hold certificate revocation lists (CRLs) for use on an SSL connection
sslCipherSuite String

  • null

  • The name of a CipherSuite

The CipherSuite to use for an SSL connection
sslFipsRequired1 boolean

  • false

  • true

Whether an SSL connection must use a CipherSuite that is supported by the IBM Java JSSE FIPS provider (IBMJSSEFIPS)
sslPeerName String

  • null

  • A template for distinguished names

For an SSL connection, a template that is used to check the distinguished name in the digital certificate provided by the queue manager
sslResetCount int

  • 0

  • An integer in the range 0 to 999 999 999

The total number bytes sent and received by an SSL connection before the secret keys used by SSL are renegotiated
subscriptionStore String

  • MIGRATE

  • QUEUE

  • BROKER

Determines where WebSphere MQ JMS stores persistent data about active subscriptions
targetClientMatching boolean

  • true

  • false

Whether a reply message, sent to the queue identified by the JMSReplyTo header field of an incoming message, has an MQRFH2 header only if the incoming message has an MQRFH2 header
tempQPrefix String

  • "" (empty string)

  • A prefix that can be used to form the name of a WebSphere MQ dynamic queue. The rules for forming the prefix are the same as those for forming the contents of the DynamicQName field in a WebSphere MQ object descriptor, structure MQOD, but the last non blank character must be an asterisk (*). If the value of the property is the empty string, WebSphere MQ JMS uses the value AMQ.* when creating a dynamic queue.

The prefix that is used to form the name of a WebSphere MQ dynamic queue.
transportType String

  • CLIENT

  • BINDINGS

Whether a connection to a queue manager uses client mode or bindings mode
username String

  • null

  • A user name

The default user name to use when creating a connection to a queue manager

  1. For important information about using the sslFipsRequired property, see Limitations of the WebSphere MQ resource adapter.

The following example shows a typical set of properties of a ConnectionFactory object:

channel:        SYSTEM.DEF.SVRCONN
hostName:       192.168.0.42
port:           1414
queueManager:   ExampleQM
transportType:  CLIENT

Table 2 lists the properties that are common to a Queue object and a Topic object.

Properties that are common to a Queue object and a Topic object
Name of property Type Valid values (default value in bold) Description
CCSID String

  • 1208

  • A coded character set identifier supported by the Java virtual machine (JVM)

The coded character set identifier for the destination
encoding String

  • NATIVE

  • A string of three characters:

    • The first character specifies the representation of binary integers:

      • N denotes normal encoding.

      • R denotes reverse encoding.

    • The second character specifies the representation of packed decimal integers:

      • N denotes normal encoding.

      • R denotes reverse encoding.

    • The third character specifies the representation of floating point numbers:

      • N denotes standard IEEE encoding.

      • R denotes reverse IEEE encoding.

      • 3 denotes zSeries encoding.

    NATIVE is equivalent to the string NNN.

The representation of binary integers, packed decimal integers, and floating point numbers for the destination.
expiry String

  • APP - The expiry time of a message is determined by the message producer.

  • UNLIM - A message never expires.

  • A positive integer representing the expiry time of a message in milliseconds.

The expiry time of a message sent to the destination
failIfQuiesce String

  • true

  • false

Whether an attempt to access the destination fails if the queue manager is in a quiescing state
persistence String

  • APP - The persistence of a message is determined by the message producer.

  • QDEF - The persistence of a message is determined by the DefPersistence attribute of the WebSphere MQ queue.

  • PERS - A message is persistent.

  • NON - A message is nonpersistent.

  • HIGH - The persistence of a message is determined by the NonPersistentMessageClass attribute of the WebSphere MQ queue according to the explanation in JMS persistent messages.

The persistence of a message sent to the destination
priority String

  • APP - The priority of a message is determined by the message producer.

  • QDEF - The priority of a message is determined by the DefPriority attribute of the WebSphere MQ queue.

  • An integer in the range 0, lowest priority, to 9, highest priority.

The priority of a message sent to the destination
targetClient String

  • JMS - The target of a message is a JMS application.

  • MQ - The target of a message is a non-JMS WebSphere MQ application.

Whether the target of a message sent to the destination is a JMS application. A message whose target is a JMS application contains an MQRFH2 header.

Table 3 lists the properties that are specific to a Queue object.

Properties that are specific to a Queue object
Name of property Type Valid values (default value in bold) Description
baseQueueManagerName String

  • "" (empty string)

  • A queue manager name

The name of the queue manager that owns the underlying WebSphere MQ queue
baseQueueName String

  • "" (empty string)

  • A queue name

The name of the underlying WebSphere MQ queue

Table 4 lists the properties that are specific to a Topic object.

Properties that are specific to a Topic object
Name of property Type Valid values (default value in bold) Description
baseTopicName String

  • "" (empty string)

  • A topic name

The name of the underlying topic
brokerCCDurSubQueue String

  • SYSTEM.JMS.D.CC.SUBSCRIBER.QUEUE

  • A queue name

The name of the queue from which a connection consumer receives durable subscription messages
brokerDurSubQueue String

  • SYSTEM.JMS.D.SUBSCRIBER.QUEUE

  • A queue name

The name of the queue from which a durable topic subscriber receives messages
brokerPubQueue String

  • Not set

  • A queue name

The name of the queue where published messages are sent (the stream queue). The value of this property overrides the value of the brokerPubQueue property of the ConnectionFactory object. However, if you do not set the value of this property, the value of the brokerPubQueue property of the ConnectionFactory object is used instead.
brokerPubQueueManager String

  • "" (empty string)

  • A queue manager name

The name of the queue manager that owns the queue where messages published on the topic are sent
brokerVersion String

  • Not set

  • 1

  • 2

The version of the broker being used. The value of this property overrides the value of the brokerVproperty of the ConnectionFactory object. However, if you do not set the value of this property, the value of the brokerVproperty of the ConnectionFactory object is used instead.

The following example shows a set of properties of a Queue object:

expiry:                UNLIM
persistence:           QDEF
baseQueueManagerName:  ExampleQM
baseQueueName:         SYSTEM.DEFAULT.LOCAL.QUEUE

The following example shows a set of properties of a Topic object:

expiry:                UNLIM
persistence:           NON
baseTopicName:         myTestTopic


uj40120_