Package com.adaptris.core.jms
Class JmsPollingConsumer
- java.lang.Object
-
- All Implemented Interfaces:
AdaptrisComponent
,AdaptrisMessageConsumer
,AdaptrisMessageWorker
,ComponentLifecycle
,ComponentLifecycleExtension
,JmsActorConfig
,JmsConnectionConfig
,MessageEventGenerator
,StateManagedComponent
@ComponentProfile(summary="Pickup messages from a JMS broker (queue or topic) by actively polling it", tag="consumer,jms", recommended=NullConnection.class) public class JmsPollingConsumer extends JmsPollingConsumerImpl
ConcreteJmsPollingConsumerImpl
implementation that can target queues or topics via an RFC6167 style destination.This differs from the standard
PtpPollingConsumer
andPasPollingConsumer
in that it supports a destination that is specified in RFC6167 style. For instancejms:queue:myQueueName
will consume from a queue calledmyQueueName
andjms:topic:myTopicName
from a topic calledmyTopicName
If you specify a topic as the destination then you should also configure
JmsPollingConsumerImpl.setClientId(String)
. There are also some custom parameters that are used as part of the URI defining the topic.subscriptionId
- which indicates the subscriptionId that should be used when attaching a subscriber to a topic;jms:topic:MyTopicName?subscriptionId=myId
would return aJmsDestination.subscriptionId()
ofmyId
. This must be specified.noLocal
- which corresponds to theSession.createConsumer(javax.jms.Destination, String, boolean)
noLocal setting. This defaults to false, if not specified.- jms:queue:MyQueueName
- jms:topic:MyTopicName?subscriptionId=mySubscriptionId
For instance you could have the following destinations:
In the adapter configuration file this class is aliased as jms-poller which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.adaptris.core.AdaptrisPollingConsumer
AdaptrisPollingConsumer.LockOperator
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
log
-
-
Constructor Summary
Constructors Constructor Description JmsPollingConsumer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
configuredEndpoint()
protected javax.jms.MessageConsumer
createConsumer()
java.lang.String
getEndpoint()
The JMS destination in RFC6167 format.void
setEndpoint(java.lang.String endpoint)
The JMS destination in RFC6167 format.JmsPollingConsumer
withEndpoint(java.lang.String s)
-
Methods inherited from class com.adaptris.core.jms.JmsPollingConsumerImpl
additionalDebug, close, configuredClientId, configuredPassword, configuredUserName, configuredVendorImplementation, createConnectionFactory, createSession, currentLogger, getAdditionalDebug, getClientId, getPassword, getUserName, getVendorImplementation, newThreadName, prepareConsumer, processMessages, setAdditionalDebug, setClientId, setPassword, setUserName, setVendorImplementation
-
Methods inherited from class com.adaptris.core.jms.BaseJmsPollingConsumerImpl
closeMessageConsumer, closeSession, configuredAcknowledgeMode, configuredCorrelationIdSource, configuredMessageListener, configuredMessageTranslator, consumeLocationKey, currentSession, doProcessMessage, getAcknowledgeMode, getCorrelationIdSource, getMessageSelector, getMessageTranslator, getReceiveTimeout, init, initConsumer, initSession, isManagedTransaction, messageConsumer, messageHandler, rollbackTimeout, setAcknowledgeMode, setCorrelationIdSource, setManagedTransaction, setMessageSelector, setMessageTranslator, setReceiveTimeout
-
Methods inherited from class com.adaptris.core.AdaptrisPollingConsumer
continueProcessingMessages, getMaxMessagesPerPoll, getPoller, getReacquireLockBetweenMessages, prepare, releaseLock, setMaxMessagesPerPoll, setPoller, setReacquireLockBetweenMessages, start, stop
-
Methods inherited from class com.adaptris.core.AdaptrisMessageConsumerImp
changeState, registerAdaptrisMessageListener, renameThread, requestClose, requestInit, requestStart, requestStop, retrieveAdaptrisMessageListener, retrieveComponentState
-
Methods 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, withUniqueID
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueId
-
Methods inherited from interface com.adaptris.core.AdaptrisMessageWorker
decode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactory
-
Methods inherited from interface com.adaptris.core.MessageEventGenerator
createName, createQualifier, isTrackingEndpoint
-
-
-
-
Method Detail
-
withEndpoint
public JmsPollingConsumer withEndpoint(java.lang.String s)
-
createConsumer
protected javax.jms.MessageConsumer createConsumer() throws javax.jms.JMSException
- Specified by:
createConsumer
in classJmsPollingConsumerImpl
- Throws:
javax.jms.JMSException
-
configuredEndpoint
protected java.lang.String configuredEndpoint()
- Specified by:
configuredEndpoint
in classJmsPollingConsumerImpl
-
getEndpoint
public java.lang.String getEndpoint()
The JMS destination in RFC6167 format.
-
setEndpoint
public void setEndpoint(java.lang.String endpoint)
The JMS destination in RFC6167 format.
-
-