org.apache.activemq.ra
public final class InboundContextSupport extends java.lang.Object
InboundContext
instance being used to process a message in the
current thread so that messages can be produced using the same session.Modifier and Type | Method and Description |
---|---|
static InboundContext |
getActiveSessionAndProducer()
Returns the current
InboundContext used by the current thread
which is processing a message. |
static void |
register(InboundContext sessionAndProducer)
Registers the session and producer which should be called before the
MessageEndpoint.beforeDelivery(java.lang.reflect.Method)
method is called. |
static void |
unregister(InboundContext sessionAndProducer)
Unregisters the session and producer which should be called after the
MessageEndpoint.afterDelivery()
method is called. |
public static InboundContext getActiveSessionAndProducer()
InboundContext
used by the current thread
which is processing a message. This allows us to access the current
Session to send a message using the same underlying session to avoid
unnecessary XA or to use regular JMS transactions while using message
driven POJOs.public static void register(InboundContext sessionAndProducer)
MessageEndpoint.beforeDelivery(java.lang.reflect.Method)
method is called.sessionAndProducer
- public static void unregister(InboundContext sessionAndProducer)
MessageEndpoint.afterDelivery()
method is called.sessionAndProducer
- Copyright © 2005-2014. All Rights Reserved.