1 Reply Latest reply on Aug 11, 2008 4:45 AM by Daniel Bevenius

    Converting an ESB message into JMS message and routing it us

    jakku reddy Newbie

      A quick question on the intended usage of one of the out-of-the-box actions - JMSRouter.

      One of the our services needs to route a message to an external JMS server at the end of its action pipeline. The consumers of this message is (are) an MBean hosted on WebLogic. Instead of going through the process of setting up the connection, sending the message,etc., can we use JMSRouter action instead which, from what I read, should automatically convert the ESB message it receives into a JMS message and route it to the configured URL addressing a topic (through the properties of the JMSRouter action) on the external JMS server. Also, by setting a reply-to EPR on the ESB message before sending it, can I have the response from the external JMS server to be routed to that EPR (in our application) ?

      Thanks,

        • 1. Re: Converting an ESB message into JMS message and routing i
          Daniel Bevenius Master

          Hi,

          yes, you are correct that you can use the JMSRouter to achieve this. By setting 'unwrap' to true the message payload will be extracted from the Message object before sending.

          The second part about having the response from the external JMS Server route back to an EPR will need the external application to handle the posting of the response.
          Upon sending the JMSRouter will set the JMSReplyTo like this:

          Destination destination = (Destination) esbMessage.getProperties().getProperty( JMSPropertiesSetter.JMS_REPLY_TO );
          if ( destination != null )
          {
           jmsMessage.setJMSReplyTo( (Destination) destination );
          }

          You could simply set the above message property to the JMS destination that you wish the external application to post to. Note the destination should be a jms gateway
          Is that what you meant?

          Regards,

          /Daniel