Example: Configuring the JMS adapter to work with JMS services
Use the publications and subscriptions elements of the JMSAdapter.xml configuration file to define the message flow for using Diffusion™ with JMS services.
<publications> <publication> <destination>jms:queue:REQUEST.QUEUE</destination> <messaging topicName="example/requests" routingProperty="JMSCorrelationID"/> </publication> </publications> <subscriptions> <subscription> <destination>jms:queue:RESPONSE.QUEUE</destination> <options noLocal="true"> <selector>JMSCorrelationID like '${serverName}/%'</selector> </options> <messaging topicName="example/responses" routingProperty="JMSCorrelationID"/> </subscription> </subscriptions>
- The routingProperty attribute describes the JMS header or property that the JMS adapter uses to set or get the client session ID.
- The noLocal attribute of the options element defines whether the JMS adapter does not retrieve messages from a JMS queue that it is the originator of.
- When subscribing to a JMS destination, the JMS adapter can
use selectors. In this example, the selector used requires that the routing
property, in this case JMSCorrelationID, contains the name
of the Diffusion server where the JMS adapter is
deployed. This prevents the JMS adapter from consuming messages that are not
intended for it.
The JMS adapter replaces the variable ${serverName} with the name of its server. The server name is defined in the serverName element of the JMSAdapter.xml file when the JMS adapter runs as a standalone client. When the JMS adapter runs within the Diffusion server, the server name is defined by the Server.xml configuration file.
This page last modified: 2018/10/28