Class XAJmsConsumer
- All Implemented Interfaces:
AdaptrisComponent,AdaptrisMessageConsumer,AdaptrisMessageWorker,ComponentLifecycle,ComponentLifecycleExtension,JmsActorConfig,LicensedComponent,MessageEventGenerator,StateManagedComponent
- Direct Known Subclasses:
XAJmsConsumerAsync
This differs from the standard PtpConsumer and PasConsumer in that it supports a
destination that is specified in RFC6167 style. For instance jms:queue:myQueueName will
consume from a queue called myQueueName and jms:topic:myTopicName from a topic
called myTopicName
While RFC6167 defines the ability to use jndi to lookup the (as part of the 'jndi' variant
section); this is not supported. There is also support for subscriptionId which indicates
the subscriptionId that should be used when attaching a subscriber to a topic;
jms:topic:MyTopicName?subscriptionId=myId would return a
JmsDestination.subscriptionId() of myId. If a subscription ID is not specified,
then a durable subscriber is never created; specifying a subscription ID automatically means a
durable subscriber.
- jms:queue:MyQueueName
- jms:topic:MyTopicName
- jms:topic:MyTopicName?subscriptionId=mySubscriptionId
Additionally this consumer uses a transaction manager to perform a two-phase commit for each transaction.
The transaction size is determined by the max-batch property. If set to 200 for example, then this consumer will attempt to commit an entire batch of 200 messages, once each has been processed. If however there are less than 200 messages on the JMS endpoint to consume and process, then this consumer will commit as many as it can consume before starting another transaction.
In the adapter configuration file this class is aliased as xa-jms-consumer which is the preferred alternative to the fully qualified classname when building your configuration.
-
Field Summary
Fields inherited from class com.adaptris.xa.jms.XAJmsConsumerImpl
consumeLock, consumer, currentTxId, executor, pollerTask, sessionFields inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
log -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.adaptris.xa.jms.XAJmsConsumerImpl
beginTransaction, close, commitTransaction, commitTransaction, configuredAcknowledgeMode, configuredCorrelationIdSource, configuredMessageListener, configuredMessageTranslator, consumeLocationKey, currentLogger, currentSession, endpoint, getConsumer, getCorrelationIdSource, getEndpoint, getGlobalLock, getMaxBatch, getMaxTransactionTime, getMessageSelector, getMessagesInCurrentTransaction, getMessageTranslator, getOnMessageHandler, getReceiveWait, getRecreateConsumerOnError, getTransactionManager, getXaExceptionHandler, getXaResourceName, globalLock, handleException, handleXAException, init, isEnabled, isManagedTransaction, messageSelector, newThreadName, prepare, processXAMessages, rollbackIfRequired, rollbackTimeout, rollbackTransaction, setConsumer, setCorrelationIdSource, setEndpoint, setGlobalLock, setMaxBatch, setMaxTransactionTime, setMessageSelector, setMessagesInCurrentTransaction, setMessageTranslator, setOnMessageHandler, setReceiveWait, setRecreateConsumerOnError, setTransactionManager, setXaExceptionHandler, setXaResourceName, start, startProcessing, stop, withEndpointMethods inherited from class com.adaptris.core.AdaptrisMessageConsumerImp
changeState, registerAdaptrisMessageListener, renameThread, requestClose, requestInit, requestStart, requestStop, retrieveAdaptrisMessageListener, retrieveComponentStateMethods inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
createName, createQualifier, decode, encode, getEncoder, getIsTrackingEndpoint, getMessageFactory, getUniqueId, handleConnectionException, isTrackingEndpoint, registerConnection, registerEncoderMessageFactory, retrieveConnection, setEncoder, setIsTrackingEndpoint, setMessageFactory, setUniqueId, withMessageFactory, withUniqueIDMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueIdMethods inherited from interface com.adaptris.core.AdaptrisMessageWorker
decode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactoryMethods inherited from interface com.adaptris.core.MessageEventGenerator
createName, createQualifier, isTrackingEndpoint
-
Constructor Details
-
XAJmsConsumer
public XAJmsConsumer()
-
-
Method Details
-
createConsumer
- Specified by:
createConsumerin classXAJmsConsumerImpl- Throws:
javax.jms.JMSExceptionCoreException
-