Announcement Announcement Module
Collapse
No announcement yet.
Using JMS Transacted Session with JmsTemplate Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using JMS Transacted Session with JmsTemplate

    Hello,

    I've been trying to use the JmsTemplate to do the following:

    * Create a transacted JMS session
    * Consume messages from a JMS Queue
    * Commit/rollback the session at some later stage

    This does not work for me.

    I'm creating my JMS session & getting the queued messages okay:

    template = new JmsTemplate102();
    template.setConnectionFactory(connectionFactory);

    template.setReceiveTimeout(100);
    template.setSessionTransacted(true);
    template.setDestinationResolver( new JndiDestinationResolver() );

    ...
    Message nextMessage =
    template.receiveSelected(selector);
    ... etc

    & then I try to commit/rollback the session using the JmsTemplate.SessionCallback

    At first glance, it looks like JmsTemplate.doReceive() is *always* committing my session, so my later commit/rollback will not succeed.

    Am I misunderstanding something here?

    Thanks in advance.

    Donal
Working...
X