From Webapp and with Apache Camel / and using MQ, do you add JMS messages using jsessionid?

I have a web application that will start a message (e.g. start processing) in an MQ message queue. I have a consumer and manufacturer configuration defined using DSL Camel Spring. I want to press a message from a web application, and only this session and client should receive a response. Can I use jsessionid and possibly some other random message identifier to set the message so that only that client gets a response?

eg. Imagine Camel Spring DSL xml Configuration:

  <route id="webRequestToInRoute">
      <to uri="activemq:queue:inbox :::: here I want to getJsessionId() as the message ... name?"/>
  </route>

More importantly, what are the ways I can exchange camel rest services between the browser on the JMS route, mainly to pull status?

+4
source share
1 answer

Web application session publishes message

  • set JMSReplyTo message header: temp-queue: //ORDER.$jSessionId
  • set the user to a temporary queue: //ORDER.$jSessionId
  • send to β†’ queue: //PROCESS.ORDER

In REST service

  • Queue Consumption: //PROCESS.ORDER
  • Make a message with a message
  • Post a response to temp-queue: //ORDER.$jSessionId

After there are no more messages, consumers or producers, the broker will automatically delete the temporary queue, so there is no cleansing necrosis

+1
source

Source: https://habr.com/ru/post/1624442/


All Articles