• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need to set attributes on httpSession while using JMS with Spring

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using org.springframework.jms.core.JmsTemplate and org.springframework.jms.listener.DefaultMessageListenerContainer to write and read from MQs.
Once the message is consumed in onMessage, I need to set values on httpSession to indicate successful processing of the request(message).

How do I do that?

I thought of using:


But that would mean serializing the complete session while sending the message.
Is there a way I can achieve this? Some listener that would set values on session probably?

Please help me with this.

I asked this question in the wrong forum earlier.

Thanks,
Giriraj.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to capture some flag which indicates you that the given message is Consumed, meaning you are trying to make a semi Request-Response call.

Sending HTTPSession with Message that would not help you, because both are in two different layers and also JMS is an ASYNC process so response will not be
immediate as the actualy task will be performed in different Thread .

So in order to address this issue, you need to create Temparary Queues to which consumer would Respond, and the message filter could be done based on CorrelationId.

Following API could be used.

replyMessage.getJMSCorrelationID());
requestMessage.setJMSReplyTo(replyQueue);


Please see more details below.

http://javaquicknotes.com/questionDelegator/JMS_Request_Response_example

Or
Just see in other java resources for sample.
reply
    Bookmark Topic Watch Topic
  • New Topic