activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mlukica <>
Subject DurableConduitBridge.createDemandSubscription() for queues
Date Tue, 10 Jun 2008 12:14:20 GMT

I have the following problem when using network of brokers connected via
- when consumer on (non temporary) queue is created on node1,
DemandSubscription is created on node2 (e.g.
NC_node1-broker_inboundlocalhost; this is expected)
- problem: when this consumer is closed, subscription is not removed

This causes following behaviour:
- when there are no consumers on given queue on any broker, messages are
always forwarded via NetworkConnector to other broker, if there was consumer
at any point in time (since DemandSubscription is never removed)

I think the problem lies in DurableConduitBridge, createDemandSubscription

When processing received remote ConsumerInfo, following code is executed:

    if (info.isDurable() || (info.getDestination().isQueue() &&
!info.getDestination().isTemporary())) {  
        info.setConsumerId(new ConsumerId(localSessionInfo.getSessionId(),

I think that condition should be changed to:

    if (info.isDurable() || (info.getDestination().isQueue() &&
info.getDestination().isTemporary())) {  
        info.setConsumerId(new ConsumerId(localSessionInfo.getSessionId(),

i.e. new ConsumerId should be created for temporary queues, and not regular
ones. With this condition changed, DemandSubscription is successfully
removed when consumer is closed on queue on other broker.

This behavior can be validated by using jconsole (via jmx) and checking
subscriptions on given queue on both brokers, depending on consumer
existence on given queue on any broker.

Described behaviour exists in: 4.1.0, 4.1.1, 4.1.2, 5.0.0 and 5.1.0.

Why should ConsumerId be replaced with new (generated) value, causing
failure of removal of given subscription when RemoveInfo is processed with
original ConsumerId?
View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message