@ComponentProfile(summary="Allows you to aggregate messages from a JMS Queue", tag="service,aggregation,jms", recommended=JmsConnection.class) public class AggregatingJmsConsumeService extends AggregatingConsumeServiceImpl<JmsConnection> implements JmsActorConfig, ConnectedService
AggregatingConsumeService
that allows you to consume a related message from a queue based on some
criteria.In the adapter configuration file this class is aliased as aggregating-jms-consume-service which is the preferred alternative to the fully qualified classname when building your configuration.
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
AggregatingJmsConsumeService() |
Modifier and Type | Method and Description |
---|---|
protected void |
closeService() |
int |
configuredAcknowledgeMode()
Return the current acknowledge mode.
|
CorrelationIdSource |
configuredCorrelationIdSource()
Return the current correlation id source.
|
AdaptrisMessageListener |
configuredMessageListener()
return the current configured MessageListener.
|
MessageTypeTranslator |
configuredMessageTranslator()
Return the currently configured messageTranslator.
|
org.slf4j.Logger |
currentLogger()
Return the configured logger.
|
javax.jms.Session |
currentSession()
Return the current jms session.
|
void |
doService(AdaptrisMessage msg)
Apply the service to the message.
|
AdaptrisConnection |
getConnection()
Returns the
AdaptrisConnection to use. |
AggregatingJmsConsumer |
getJmsConsumer() |
protected void |
initService() |
boolean |
isManagedTransaction() |
void |
prepare()
Prepare for initialisation.
|
long |
rollbackTimeout()
How long we should wait after a rollback before continuing on with
processing
|
void |
setConnection(AdaptrisConnection connection)
Sets the
AdaptrisConnection to use. |
void |
setJmsConsumer(AggregatingJmsConsumer consumer) |
void |
start()
Starts the component.
|
void |
stop()
Stop the component
|
start, stop
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setLookupName, setUniqueId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
continueOnFailure, isBranching, setUniqueId
createName, createQualifier, isTrackingEndpoint
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
getUniqueId
close, init
getLookupName
protected void initService() throws CoreException
initService
in class AggregatingConsumeServiceImpl<JmsConnection>
CoreException
public void start() throws CoreException
ComponentLifecycle
Once a component is started it should be ready to process messages. In the case of AdaptrisMessageConsumer
, calling start
will begin message delivery.
start
in interface ComponentLifecycle
start
in class AggregatingConsumeServiceImpl<JmsConnection>
CoreException
- wrapping any underlying Exception
spublic void stop()
ComponentLifecycle
A stopped component is not expected to be ready to process messages. In the case of AdaptrisMessageConsumer
, calling stop
will pause message delivery. Throwing a RuntimeException
may cause unintended consequences
stop
in interface ComponentLifecycle
stop
in class AggregatingConsumeServiceImpl<JmsConnection>
protected void closeService()
closeService
in class AggregatingConsumeServiceImpl<JmsConnection>
public void prepare() throws CoreException
ComponentLifecycleExtension
prepare
in interface ComponentLifecycleExtension
CoreException
public void doService(AdaptrisMessage msg) throws ServiceException
Service
Apply the service to the message.
doService
in interface Service
msg
- the AdaptrisMessage
to processServiceException
- wrapping any underlying Exception
spublic MessageTypeTranslator configuredMessageTranslator()
JmsActorConfig
configuredMessageTranslator
in interface JmsActorConfig
public int configuredAcknowledgeMode()
JmsActorConfig
configuredAcknowledgeMode
in interface JmsActorConfig
public CorrelationIdSource configuredCorrelationIdSource()
JmsActorConfig
configuredCorrelationIdSource
in interface JmsActorConfig
public AdaptrisMessageListener configuredMessageListener()
JmsActorConfig
configuredMessageListener
in interface JmsActorConfig
public javax.jms.Session currentSession()
JmsActorConfig
currentSession
in interface JmsActorConfig
public org.slf4j.Logger currentLogger()
JmsActorConfig
currentLogger
in interface JmsActorConfig
public long rollbackTimeout()
JmsActorConfig
rollbackTimeout
in interface JmsActorConfig
public AggregatingJmsConsumer getJmsConsumer()
public void setJmsConsumer(AggregatingJmsConsumer consumer)
public AdaptrisConnection getConnection()
ConnectedService
AdaptrisConnection
to use.getConnection
in interface ConnectedService
AdaptrisConnection
public void setConnection(AdaptrisConnection connection)
ConnectedService
AdaptrisConnection
to use.setConnection
in interface ConnectedService
connection
- the AdaptrisConnection
to usepublic boolean isManagedTransaction()
isManagedTransaction
in interface JmsActorConfig