Just a second...

Using JMS request-response services with the JMS adapter

You can use the messaging capabilities of the JMS adapter to interact with a JMS service through request-response.

Exposing a JMS service through Diffusion™ messaging is a typical use case for the JMS adapter.

Figure 1. JMS adapter: Request-response message flow Request response flow corresponding to the following description.
  1. A Diffusion client sends a message to a Diffusion message path configured in the JMS adapter to receive service requests.
  2. The JMS adapter receives the message on the request message path.
  3. The JMS adapter transforms the Diffusion message into a JMS message. For more information, see Transforming JMS messages into Diffusion messages or updates.
  4. The JMS adapter adds a routing property or header to the JMS message identifying the Diffusion server and client to return a response to. This return information is of the form server_name/client_session_id.
  5. The JMS adapter sends the message to the JMS service request queue.
  6. The JMS service receives the request.
  7. The JMS service acts on the request.
  8. The JMS service places a response message on its response queue. This message must include the routing property or header that identifies the Diffusion server and client to return the response to.
  9. The JMS adapter receives the response message from the JMS response queue.
  10. The JMS adapter transforms the response message into a Diffusion message. For more information, see Transforming JMS messages into Diffusion messages or updates.
  11. The JMS adapter uses the information in the routing property or header to discover the connected client session to relay the response to.
  12. The JMS adapter sends the response message to the Diffusion client through a message path.

Error scenarios

  • The JMS adapter consumes a message from a JMS service response queue 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 queue 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.