title: JMS sync request-reply from stateless EJB
body: <p>I have a system based on JMS queues that enable the whole system to work in async fashion.</p>
  
  <p>Now, for some periodic tasks I need to execute some non time consuming tasks in sync way, so that I can do something with the result right away, without using a database for storing request and pairing it with result (as with async operation).</p>
  
  <p>The code itself is not a problem, but the fact that EJBs run container transactions, which means that the producer.send() code and consumer.receive() will not execute sequentially (i.e. message is not sent, so nothing to receive in the receive() few lines bellow).</p>
  
  <p>How can I have JMS message sent and response received in sync fashion in stateless EJB3 environment?</p>
  
  <p>Thanks for answers,</p>
  
  <p>Bozo</p>