mirror of https://github.com/apache/activemq.git
git-svn-id: https://svn.apache.org/repos/asf/activemq/branches/activemq-4.1@559015 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bb4a890b7a
commit
9b5acf4fa1
|
@ -27,9 +27,12 @@ import org.apache.activemq.command.DataStructure;
|
||||||
import org.apache.activemq.command.DestinationInfo;
|
import org.apache.activemq.command.DestinationInfo;
|
||||||
import org.apache.activemq.command.MessageAck;
|
import org.apache.activemq.command.MessageAck;
|
||||||
import org.apache.activemq.command.MessageDispatch;
|
import org.apache.activemq.command.MessageDispatch;
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
public class AdvisoryConsumer implements ActiveMQDispatcher {
|
public class AdvisoryConsumer implements ActiveMQDispatcher {
|
||||||
|
|
||||||
|
private static final transient Log log = LogFactory.getLog(AdvisoryConsumer.class);
|
||||||
private final ActiveMQConnection connection;
|
private final ActiveMQConnection connection;
|
||||||
private ConsumerInfo info;
|
private ConsumerInfo info;
|
||||||
private boolean closed;
|
private boolean closed;
|
||||||
|
@ -48,6 +51,11 @@ public class AdvisoryConsumer implements ActiveMQDispatcher {
|
||||||
|
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
if (!closed) {
|
if (!closed) {
|
||||||
|
try {
|
||||||
|
this.connection.asyncSendPacket(info.createRemoveCommand());
|
||||||
|
} catch (JMSException e) {
|
||||||
|
log.info("Failed to send remove command: " + e, e);
|
||||||
|
}
|
||||||
this.connection.removeDispatcher(info.getConsumerId());
|
this.connection.removeDispatcher(info.getConsumerId());
|
||||||
closed = true;
|
closed = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue