public class AggregatingQueueConsumer extends AggregatingConsumerImpl<AggregatingJmsConsumeService> implements AggregatingJmsConsumer
AggregatingConsumer
implementation that allows you to read a separate message(s) from a queue that need to be aggregated
with the current message.
The JMS Queue and message selector are created from the generated ConsumeDestination.getDestination()
and
ConsumeDestination.getFilterExpression()
respectively.
getTimeout()
), then additional messages are
waited for based on the same timeout. Once the timeout expires then all the messages are aggregated using the configured
aggregator.In the adapter configuration file this class is aliased as aggregating-queue-consumer which is the preferred alternative to the fully qualified classname when building your configuration.
log
Constructor and Description |
---|
AggregatingQueueConsumer() |
AggregatingQueueConsumer(ConsumeDestinationGenerator d) |
Modifier and Type | Method and Description |
---|---|
void |
aggregateMessages(AdaptrisMessage msg,
AggregatingJmsConsumeService cfg)
Perform the aggregation.
|
MessageTypeTranslator |
getMessageTranslator() |
TimeInterval |
getTimeout() |
void |
setMessageTranslator(MessageTypeTranslator translator)
Set the jms message translator.
|
void |
setTimeout(TimeInterval t)
Set the timeout to wait for the correlated message.
|
protected void |
startMessageTranslator(JmsActorConfig cfg,
AdaptrisMessageFactory factory) |
close, getDestination, getMessageAggregator, init, rethrowServiceException, setDestination, setMessageAggregator, start, start, stop, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, init, start, stop
public AggregatingQueueConsumer()
public AggregatingQueueConsumer(ConsumeDestinationGenerator d)
public void aggregateMessages(AdaptrisMessage msg, AggregatingJmsConsumeService cfg) throws ServiceException
AggregatingConsumer
aggregateMessages
in interface AggregatingConsumer<AggregatingJmsConsumeService>
msg
- the current message being processed.cfg
- the service that relates to this consumer implementation.ServiceException
public TimeInterval getTimeout()
public void setTimeout(TimeInterval t)
t
- the timeout to set, if not specified then it defaults to 30 seconds.protected void startMessageTranslator(JmsActorConfig cfg, AdaptrisMessageFactory factory) throws CoreException
CoreException
public MessageTypeTranslator getMessageTranslator()
public void setMessageTranslator(MessageTypeTranslator translator)
translator
- the translator.