@ComponentProfile(summary="Listen for JMS messages on the specified queue or topic", tag="consumer,jms", recommended=JmsConnection.class) public class JmsConsumer extends JmsConsumerImpl
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.
Also supported is the JMS 2.0 sharedConsumerId, should you wish to create a multiple load balancing consumers on a single topic endpoint;
jms:topic:MyTopicName?sharedConsumerId=12345
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.
consumer
log
Constructor and Description |
---|
JmsConsumer() |
Modifier and Type | Method and 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) |
close, configuredAcknowledgeMode, configuredCorrelationIdSource, configuredMessageListener, configuredMessageTranslator, consumeLocationKey, currentLogger, currentSession, endpoint, getAcknowledgeMode, getCorrelationIdSource, getDestination, getMessageSelector, getMessageTranslator, init, isManagedTransaction, messageSelector, newThreadName, onMessage, prepare, rollbackTimeout, setAcknowledgeMode, setCorrelationIdSource, setDestination, setManagedTransaction, setMessageSelector, setMessageTranslator, 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
public JmsConsumer withEndpoint(java.lang.String s)
protected java.lang.String configuredEndpoint()
configuredEndpoint
in class JmsConsumerImpl
protected javax.jms.MessageConsumer createConsumer() throws javax.jms.JMSException, CoreException
createConsumer
in class JmsConsumerImpl
javax.jms.JMSException
CoreException
protected java.lang.Boolean deferConsumerCreationToVendor()
public java.lang.Boolean getDeferConsumerCreationToVendor()
The default is false such that we use standard JMS 1.1/2.0 methods to create the appropriate consumers.
public void setDeferConsumerCreationToVendor(java.lang.Boolean deferConsumerCreationToVendor)
The default is false such that we use standard JMS 1.1/2.0 methods to create the appropriate consumers.
public java.lang.String getEndpoint()
public void setEndpoint(java.lang.String endpoint)