org.apache.activemq.advisory
public class ConsumerEventSource extends java.lang.Object implements Service, javax.jms.MessageListener
Constructor and Description |
---|
ConsumerEventSource(javax.jms.Connection connection,
javax.jms.Destination destination) |
Modifier and Type | Method and Description |
---|---|
protected int |
extractConsumerCountFromMessage(javax.jms.Message message,
int count)
Lets rely by default on the broker telling us what the consumer count is
as it can ensure that we are up to date at all times and have not
received messages out of order etc.
|
protected void |
fireConsumerEvent(ConsumerEvent event) |
java.lang.String |
getConsumerId() |
void |
onMessage(javax.jms.Message message) |
void |
setConsumerListener(ConsumerListener listener) |
void |
start() |
void |
stop() |
public ConsumerEventSource(javax.jms.Connection connection, javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSException
public void setConsumerListener(ConsumerListener listener)
public java.lang.String getConsumerId()
public void start() throws java.lang.Exception
public void stop() throws java.lang.Exception
public void onMessage(javax.jms.Message message)
onMessage
in interface javax.jms.MessageListener
protected int extractConsumerCountFromMessage(javax.jms.Message message, int count)
protected void fireConsumerEvent(ConsumerEvent event)
Copyright © 2005-2014. All Rights Reserved.