Class PasPollingConsumer
- java.lang.Object
-
- All Implemented Interfaces:
AdaptrisComponent
,AdaptrisMessageConsumer
,AdaptrisMessageWorker
,ComponentLifecycle
,ComponentLifecycleExtension
,JmsActorConfig
,JmsConnectionConfig
,MessageEventGenerator
,StateManagedComponent
@ComponentProfile(summary="Pickup messages from a JMS Topic by actively polling for them", tag="consumer,jms", recommended=NullConnection.class) public class PasPollingConsumer extends JmsPollingConsumerImpl
PAS implementation of
JmsPollingConsumer
. The consumer created by this class is always durable and thus requires the clientID and subscriptionId to be set. It is up to the user to ensure that these are set such that this consumer is uniquely identified in the context of the broker's other consumers.In the adapter configuration file this class is aliased as jms-topic-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 PasPollingConsumer()
-
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
getSubscriptionId()
Returns the subscription ID to use.java.lang.String
getTopic()
The JMS Topicvoid
init()
Initialises the component.void
setSubscriptionId(java.lang.String s)
Sets the subscription ID to use.void
setTopic(java.lang.String topic)
The JMS TopicPasPollingConsumer
withTopic(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, 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
-
configuredEndpoint
protected java.lang.String configuredEndpoint()
- Specified by:
configuredEndpoint
in classJmsPollingConsumerImpl
-
init
public void init() throws CoreException
Description copied from interface:ComponentLifecycle
Initialises the component.Component initialisation includes config verification, creation of connections etc.
- Specified by:
init
in interfaceComponentLifecycle
- Overrides:
init
in classBaseJmsPollingConsumerImpl
- Throws:
CoreException
- wrapping any underlyingException
s- See Also:
ComponentLifecycle.init()
-
createConsumer
protected javax.jms.MessageConsumer createConsumer() throws javax.jms.JMSException
- Specified by:
createConsumer
in classJmsPollingConsumerImpl
- Throws:
javax.jms.JMSException
-
withTopic
public PasPollingConsumer withTopic(java.lang.String s)
-
getSubscriptionId
public java.lang.String getSubscriptionId()
Returns the subscription ID to use.
- Returns:
- subscriptionId the subscription ID to use
-
setSubscriptionId
public void setSubscriptionId(java.lang.String s)
Sets the subscription ID to use. This, in combination with the clientId should uniquely identify this subscription in the context of the broker.
- Parameters:
s
- the subscription ID to use- See Also:
JmsPollingConsumerImpl
-
getTopic
public java.lang.String getTopic()
The JMS Topic
-
setTopic
public void setTopic(java.lang.String topic)
The JMS Topic
-
-