Package org.apache.camel.component.sjms
Class SjmsConsumer
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultConsumer
-
- org.apache.camel.component.sjms.SjmsConsumer
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.Consumer
,org.apache.camel.EndpointAware
,org.apache.camel.RouteAware
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.RouteIdAware
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
public class SjmsConsumer extends org.apache.camel.support.DefaultConsumer
The SjmsConsumer is the base class for the SJMS MessageListener pool.
-
-
Constructor Summary
Constructors Constructor Description SjmsConsumer(org.apache.camel.Endpoint endpoint, org.apache.camel.Processor processor)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected javax.jms.MessageListener
createMessageHandler(javax.jms.Session session)
Helper factory method used to create a MessageListener based on the MEPvoid
destroyObject(MessageConsumerResources model)
protected void
doStart()
protected void
doStop()
int
getAcknowledgementMode()
protected ConnectionResource
getConnectionResource()
Deprecated.int
getConsumerCount()
Returns the number of consumer listeners.String
getDestinationName()
The destination name for this consumer.String
getDurableSubscriptionId()
Gets the durable subscription Id.SjmsEndpoint
getEndpoint()
String
getMessageSelector()
Gets the JMS Message selector syntax.protected ConnectionResource
getOrCreateConnectionResource()
int
getTransactionBatchCount()
If transacted, returns the nubmer of messages to be processed before committing the transaction.long
getTransactionBatchTimeout()
Returns the timeout value for batch transactions.TransactionCommitStrategy
getTransactionCommitStrategy()
Gets the commit strategy.boolean
isSharedJMSSession()
Use to determine if JMS session should be propagated to share with other SJMS endpoints.boolean
isSynchronous()
Use to determine whether or not to process exchanges synchronously.boolean
isTopic()
Flag set by the endpoint used by consumers and producers to determine if the consumer is a JMS Topic.boolean
isTransacted()
Use to determine if transactions are enabled or disabled.-
Methods inherited from class org.apache.camel.support.DefaultConsumer
createUoW, doInit, doneUoW, getAsyncProcessor, getExceptionHandler, getProcessor, getRoute, getRouteId, handleException, handleException, setExceptionHandler, setRoute, setRouteId, toString
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
getEndpoint
public SjmsEndpoint getEndpoint()
- Specified by:
getEndpoint
in interfaceorg.apache.camel.EndpointAware
- Overrides:
getEndpoint
in classorg.apache.camel.support.DefaultConsumer
-
doStart
protected void doStart() throws Exception
- Overrides:
doStart
in classorg.apache.camel.support.DefaultConsumer
- Throws:
Exception
-
destroyObject
public void destroyObject(MessageConsumerResources model)
-
doStop
protected void doStop() throws Exception
- Overrides:
doStop
in classorg.apache.camel.support.DefaultConsumer
- Throws:
Exception
-
createMessageHandler
protected javax.jms.MessageListener createMessageHandler(javax.jms.Session session)
Helper factory method used to create a MessageListener based on the MEP- Parameters:
session
- a session is only required if we are a transacted consumer- Returns:
- the listener
-
getConnectionResource
@Deprecated protected ConnectionResource getConnectionResource()
Deprecated.
-
getOrCreateConnectionResource
protected ConnectionResource getOrCreateConnectionResource()
-
getAcknowledgementMode
public int getAcknowledgementMode()
-
isTransacted
public boolean isTransacted()
Use to determine if transactions are enabled or disabled.- Returns:
- true if transacted, otherwise false
-
isSharedJMSSession
public boolean isSharedJMSSession()
Use to determine if JMS session should be propagated to share with other SJMS endpoints.- Returns:
- true if shared, otherwise false
-
isSynchronous
public boolean isSynchronous()
Use to determine whether or not to process exchanges synchronously.- Returns:
- true if synchronous
-
getDestinationName
public String getDestinationName()
The destination name for this consumer.- Returns:
- String
-
getConsumerCount
public int getConsumerCount()
Returns the number of consumer listeners.- Returns:
- the consumerCount
-
isTopic
public boolean isTopic()
Flag set by the endpoint used by consumers and producers to determine if the consumer is a JMS Topic.- Returns:
- the topic true if consumer is a JMS Topic, default is false
-
getMessageSelector
public String getMessageSelector()
Gets the JMS Message selector syntax.
-
getDurableSubscriptionId
public String getDurableSubscriptionId()
Gets the durable subscription Id.- Returns:
- the durableSubscriptionId
-
getTransactionCommitStrategy
public TransactionCommitStrategy getTransactionCommitStrategy()
Gets the commit strategy.- Returns:
- the transactionCommitStrategy
-
getTransactionBatchCount
public int getTransactionBatchCount()
If transacted, returns the nubmer of messages to be processed before committing the transaction.- Returns:
- the transactionBatchCount
-
getTransactionBatchTimeout
public long getTransactionBatchTimeout()
Returns the timeout value for batch transactions.- Returns:
- long
-
-