Sending messages using the JMS adapter
The JMS adapter can send messages from a Diffusion™ client to a JMS destination and messages from a JMS destination to a specific Diffusion client.
Sending a message from a Diffusion client to a JMS destination
You can configure the JMS adapter to handle messages sent on a Diffusion message path and to associated messages received on that message path with a JMS destination.
- A Diffusion client sends a message to a message path.
- The JMS adapter receives the message.
- The JMS adapter transforms the Diffusion message into a JMS message. For more information, see Transforming JMS messages into Diffusion messages or updates.
- The JMS adapter sets a JMS header or property to include the Diffusion server name of the JMS adapter and the
session ID of the Diffusion client.
This header or property is used as a return address for any response messages and is nominated using the routingProperty configuration element. By convention, JMS CorrelationID is often used. For more information, see JMSAdapter.xml.
- The JMS adapter publishes the transformed message to the JMS destination.
Sending a message from a JMS destination to a Diffusion client
You can configure the JMS adapter to subscribe to a JMS destination and to associate that subscription with a Diffusion message path to send a message through.
- The JMS adapter receives a message from a JMS destination.
- The JMS adapter transforms the JMS message into a Diffusion message. For more information, see Transforming JMS messages into Diffusion messages or updates.
- The JMS adapter checks the nominated JMS header or property for the server
name and session ID of the recipient client.
This header or property is nominated using the routingProperty configuration element. For more information, see JMSAdapter.xml.
- The JMS adapter sends the transformed message through the message path to the recipient client session.
Error scenarios
- The JMS adapter consumes a message from a JMS destination that is not
intended for it. That is, the routing property or header does not contain
the Diffusion server name of the JMS adapter.
In this case, the JMS adapter drops the message and logs the failure to deliver.
You can avoid this scenario by using a JMS selector when subscribing to the JMS destination that specifies the JMS adapter is only interested in messages whose routing property or header include its Diffusion server name.
- The JMS adapter receives a message from a Diffusion client, but cannot send it on to JMS
because the JMS provider is not connected.
In this case, the JMS adapter returns the message to the client on the same topic and logs the failure to deliver.
- The JMS adapter receives a message from a JMS destination, but
cannot send it on to the Diffusion client because
the Diffusion client is not connected.
In this case, the JMS adapter drops the message and logs the failure to deliver.