2 Replies Latest reply on Jul 28, 2011 4:11 PM by michal.warecki

    Complex route question

    michal.warecki

      Hi,

       

      I have to implement quite "complex" route and I don't know if it is possible:

       

      -receive jaws request.

         -send payload to specified jaxrs service (may be one way or request-response with simple status message). Payload contains some key.

         -wait for message from specified jms queue with specified header (based on key from payload).

      -response jaxws with payload from jms.

       

      JaxWS has to be synchronous. It is possible to create such route?

        • 1. Re: Complex route question
          davsclaus

          Sometimes its easier to implement that logic in a java bean, and then use ProducerTemplate to easily send a message and wait for the reply.

           

          Then the route is just

           

          from (jaxws)

            to(myBean)

           

          In terms of the JMS queue, you can use a consumerTemplate to wait for the reply. It supports a timeout value.

           

          You can use JMSSelector only pickup the message with that header you need. However JMSSelector comes with a performance penalty.

           

           

          You can also use EIPs for this. Then you would need to use EIPs such as Content Enricher

          http://camel.apache.org/content-enricher.html

          • 2. Re: Complex route question
            michal.warecki

            Thanks!

             

            ProducerTemplate and ConsumerTemplate that is exacly what I want.