public abstract class JmsPollingConsumerImpl extends BaseJmsPollingConsumerImpl implements JmsConnectionConfig
AdaptrisPollingConsumer
for queues and topics.
The behaviour of this consumer differs from the standard JmsConsumerImpl
concrete
implementations. This consumer has the following steps.
Message
within the given BaseJmsPollingConsumerImpl.getReceiveTimeout()
.
javax.jms.Message
and repeats until no more messages.If connection attempt fails, the poller sleeps for the configured interval then tries again.
AdaptrisPollingConsumer.LockOperator
log
Constructor and Description |
---|
JmsPollingConsumerImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
additionalDebug() |
void |
close()
Closes the component.
|
java.lang.String |
configuredClientId()
The client id.
|
protected abstract java.lang.String |
configuredEndpoint() |
java.lang.String |
configuredPassword()
The password.
|
java.lang.String |
configuredUserName()
The username.
|
VendorImplementation |
configuredVendorImplementation()
The vendor specific implementation.
|
protected javax.jms.ConnectionFactory |
createConnectionFactory() |
protected abstract javax.jms.MessageConsumer |
createConsumer() |
protected javax.jms.Session |
createSession(int acknowledgeMode,
boolean transacted) |
org.slf4j.Logger |
currentLogger()
Return the configured logger.
|
protected java.lang.String |
endpoint() |
java.lang.Boolean |
getAdditionalDebug()
Set additional trace debug logs
|
java.lang.String |
getClientId() |
ConsumeDestination |
getDestination()
Deprecated.
since 3.11.0 use the endpoint/queue/topic configuration available on the concrete
consumer
|
java.lang.String |
getPassword() |
java.lang.String |
getUserName() |
@NonNull VendorImplementation |
getVendorImplementation() |
protected java.lang.String |
messageSelector() |
protected java.lang.String |
newThreadName() |
protected void |
prepareConsumer() |
protected int |
processMessages()
Implemented by protocol-specific sub-classes.
|
void |
setAdditionalDebug(java.lang.Boolean additionalDebug)
Set additional trace debug logs
|
void |
setClientId(java.lang.String s)
Sets the optional JMS client ID.
|
void |
setDestination(ConsumeDestination destination)
Deprecated.
since 3.11.0 use the endpoint/queue/topic configuration available on the concrete
consumer
|
void |
setPassword(java.lang.String s)
Sets the password for the specified user.
|
void |
setUserName(java.lang.String s) |
void |
setVendorImplementation(@NonNull VendorImplementation vendorImplementation) |
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
continueProcessingMessages, getMaxMessagesPerPoll, getPoller, getReacquireLockBetweenMessages, prepare, releaseLock, setMaxMessagesPerPoll, setPoller, setReacquireLockBetweenMessages, start, stop
changeState, registerAdaptrisMessageListener, renameThread, requestClose, requestInit, requestStart, requestStop, retrieveAdaptrisMessageListener, retrieveComponentState
createName, createQualifier, decode, encode, getEncoder, getIsTrackingEndpoint, getMessageFactory, getUniqueId, handleConnectionException, isTrackingEndpoint, registerConnection, registerEncoderMessageFactory, retrieveConnection, setEncoder, setIsTrackingEndpoint, setMessageFactory, setUniqueId, withMessageFactory, withUniqueID
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactory
getUniqueId
createName, createQualifier, isTrackingEndpoint
protected void prepareConsumer() throws CoreException
prepareConsumer
in class AdaptrisPollingConsumer
CoreException
protected java.lang.String messageSelector()
protected java.lang.String endpoint()
protected java.lang.String newThreadName()
newThreadName
in class AdaptrisMessageConsumerImp
protected abstract java.lang.String configuredEndpoint()
protected javax.jms.ConnectionFactory createConnectionFactory() throws java.lang.Exception
java.lang.Exception
protected javax.jms.Session createSession(int acknowledgeMode, boolean transacted) throws javax.jms.JMSException
createSession
in class BaseJmsPollingConsumerImpl
javax.jms.JMSException
protected abstract javax.jms.MessageConsumer createConsumer() throws javax.jms.JMSException
createConsumer
in class BaseJmsPollingConsumerImpl
javax.jms.JMSException
protected int processMessages()
AdaptrisPollingConsumer
Implemented by protocol-specific sub-classes.
processMessages
in class AdaptrisPollingConsumer
public void close()
ComponentLifecycle
A closed component should release any connections it uses, etc. and clean up completely. Throwing a RuntimeException
may
cause unintended consequences
close
in interface ComponentLifecycle
close
in class BaseJmsPollingConsumerImpl
ComponentLifecycle.close()
public java.lang.String getClientId()
public void setClientId(java.lang.String s)
Sets the optional JMS client ID. May not be empty, null means don't use client ID.
s
- the optional JMS client ID, defaults to null.public java.lang.String getPassword()
public void setPassword(java.lang.String s)
Sets the password for the specified user.
In additional to plain text passwords, the passwords can also be encrypted
using the appropriate Password
s
- the password for the specified userpublic java.lang.String getUserName()
public void setUserName(java.lang.String s)
public org.slf4j.Logger currentLogger()
JmsActorConfig
currentLogger
in interface JmsActorConfig
public java.lang.String configuredClientId()
JmsConnectionConfig
configuredClientId
in interface JmsConnectionConfig
public java.lang.String configuredPassword()
JmsConnectionConfig
configuredPassword
in interface JmsConnectionConfig
public java.lang.String configuredUserName()
JmsConnectionConfig
configuredUserName
in interface JmsConnectionConfig
public VendorImplementation configuredVendorImplementation()
JmsConnectionConfig
configuredVendorImplementation
in interface JmsConnectionConfig
public boolean additionalDebug()
@NonNull public @NonNull VendorImplementation getVendorImplementation()
public void setVendorImplementation(@NonNull @NonNull VendorImplementation vendorImplementation)
public java.lang.Boolean getAdditionalDebug()
public void setAdditionalDebug(java.lang.Boolean additionalDebug)
@Deprecated @Removal(version="4.0.0", message="since 3.11.0 use the endpoint/queue/topic configuration available on the concrete consumer") public ConsumeDestination getDestination()
Depending on the flavour of the concrete consumer it may be a RFC6167 style string, a queue or a topic
@Deprecated public void setDestination(@Removal(version="4.0.0",message="since 3.11.0 use the endpoint/queue/topic configuration available on the concrete consumer") ConsumeDestination destination)
Depending on the flavour of the concrete consumer it may be a RFC6167 style string, a queue or a topic