Class JmsConsumer
- java.lang.Object
-
- com.adaptris.core.AdaptrisMessageWorkerImp
-
- com.adaptris.core.AdaptrisMessageConsumerImp
-
- com.adaptris.core.jms.JmsConsumerImpl
-
- com.adaptris.core.jms.JmsConsumer
-
- All Implemented Interfaces:
AdaptrisComponent
,AdaptrisMessageConsumer
,AdaptrisMessageWorker
,ComponentLifecycle
,ComponentLifecycleExtension
,JmsActorConfig
,MessageEventGenerator
,StateManagedComponent
,javax.jms.MessageListener
@ComponentProfile(summary="Listen for JMS messages on the specified queue or topic", tag="consumer,jms", recommended=JmsConnection.class) public class JmsConsumer extends JmsConsumerImpl
JMS Consumer implementation that can target queues or topics via an RFC6167 style destination.This differs from the standard
PtpConsumer
andPasConsumer
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
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 aJmsDestination.subscriptionId()
ofmyId
. If a subscription ID is not specified, then a durable subscriber is never created; specifying a subscription ID automatically means a durable subscriber.Also supported is the JMS 2.0 sharedConsumerId, should you wish to create a multiple load balancing consumers on a single topic endpoint;
For instance you could have the following destinations:jms:topic:MyTopicName?sharedConsumerId=12345
- jms:queue:MyQueueName
- jms:topic:MyTopicName
- jms:topic:MyTopicName?subscriptionId=mySubscriptionId
- jms:topic:MyTopicName?sharedConsumerId=mySharedConsumerId
- jms:topic:MyTopicName?subscriptionId=mySubscriptionId&sharedConsumerId=mySharedConsumerId
In the adapter configuration file this class is aliased as jms-consumer which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.jms.JmsConsumerImpl
consumer
-
Fields inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
log
-
-
Constructor Summary
Constructors Constructor Description JmsConsumer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
configuredEndpoint()
protected javax.jms.MessageConsumer
createConsumer()
protected java.lang.Boolean
deferConsumerCreationToVendor()
java.lang.Boolean
getDeferConsumerCreationToVendor()
Set to true if you wish to let the JMS message consumer be delegated by the configured vendor implementation.java.lang.String
getEndpoint()
The RFC6167 format topic/queue.void
setDeferConsumerCreationToVendor(java.lang.Boolean deferConsumerCreationToVendor)
Set to true if you wish to let the JMS message consumer be delegated by the configured vendor implementation.void
setEndpoint(java.lang.String endpoint)
The RFC6167 format topic/queue.JmsConsumer
withEndpoint(java.lang.String s)
-
Methods inherited from class com.adaptris.core.jms.JmsConsumerImpl
close, configuredAcknowledgeMode, configuredCorrelationIdSource, configuredMessageListener, configuredMessageTranslator, consumeLocationKey, currentLogger, currentSession, getAcknowledgeMode, getCorrelationIdSource, getMessageSelector, getMessageTranslator, init, isManagedTransaction, newThreadName, onMessage, prepare, rollbackTimeout, setAcknowledgeMode, setCorrelationIdSource, setManagedTransaction, setMessageSelector, setMessageTranslator, 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 JmsConsumer withEndpoint(java.lang.String s)
-
configuredEndpoint
protected java.lang.String configuredEndpoint()
- Specified by:
configuredEndpoint
in classJmsConsumerImpl
-
createConsumer
protected javax.jms.MessageConsumer createConsumer() throws javax.jms.JMSException, CoreException
- Specified by:
createConsumer
in classJmsConsumerImpl
- Throws:
javax.jms.JMSException
CoreException
-
deferConsumerCreationToVendor
protected java.lang.Boolean deferConsumerCreationToVendor()
-
getDeferConsumerCreationToVendor
public java.lang.Boolean getDeferConsumerCreationToVendor()
Set to true if you wish to let the JMS message consumer be delegated by the configured vendor implementation.The default is false such that we use standard JMS 1.1/2.0 methods to create the appropriate consumers.
-
setDeferConsumerCreationToVendor
public void setDeferConsumerCreationToVendor(java.lang.Boolean deferConsumerCreationToVendor)
Set to true if you wish to let the JMS message consumer be delegated by the configured vendor implementation.The default is false such that we use standard JMS 1.1/2.0 methods to create the appropriate consumers.
-
getEndpoint
public java.lang.String getEndpoint()
The RFC6167 format topic/queue.
-
setEndpoint
public void setEndpoint(java.lang.String endpoint)
The RFC6167 format topic/queue.
-
-