|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atomikos.jms.MessageConsumerSessionPool com.atomikos.jms.QueueReceiverSessionPool
public class QueueReceiverSessionPool
A pool of QueueReceiverSession instances, for activating multiple threads on the same queue. Upon start, an instance of this class will create a number of concurrent sessions that listen for incoming messages on the same queue. MessageListener instances should be thread-safe if the pool size is larger than one. Note: in general, after start() any changed properties are only effective on the next start() event.
IMPORTANT: the transactional behaviour guarantees redelivery after failures.
As a side-effect, this can lead to so-called poison messages: messages
whose processing repeatedly fails due to some recurring error (for instance, a primary
key violation in the database, a NullPointerException, ...). Poison messages are problematic
because they can prevent other messages from being processed, and block the system.
Some messaging systems
provide a way to deal with poison messages, others don't. In that case, it is up
to the registered MessageListener to detect poison messages. The easiest way to
detect these is by inspecting the JMSRedelivered
header and/or the
(sometimes available) JMS property called JMSXDeliveryCount
. For instance, if the
delivery count is too high then your application may choose to send the message to
a dedicated problem queue and thereby avoid processing errors. Whatever you do, beware
that messages are sometimes correctly redelivered, in particular after a prior crash of the
application.
Constructor Summary | |
---|---|
QueueReceiverSessionPool()
|
Method Summary | |
---|---|
protected MessageConsumerSession |
createSession()
|
protected boolean |
getNoLocal()
|
javax.jms.Queue |
getQueue()
Get the queue to listen on. |
QueueConnectionFactoryBean |
getQueueConnectionFactoryBean()
Get the connection factory bean. |
protected String |
getSubscriberName()
|
void |
setQueue(javax.jms.Queue queue)
Set the queue to listen on (required). |
void |
setQueueConnectionFactoryBean(QueueConnectionFactoryBean bean)
Set the connection factory to use (required). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QueueReceiverSessionPool()
Method Detail |
---|
public javax.jms.Queue getQueue()
public QueueConnectionFactoryBean getQueueConnectionFactoryBean()
public void setQueue(javax.jms.Queue queue)
queue
- public void setQueueConnectionFactoryBean(QueueConnectionFactoryBean bean)
bean
- protected MessageConsumerSession createSession()
createSession
in class MessageConsumerSessionPool
protected boolean getNoLocal()
getNoLocal
in class MessageConsumerSessionPool
protected String getSubscriberName()
getSubscriberName
in class MessageConsumerSessionPool
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |