On 09/03/2015 09:54 PM, jjw tectec wrote:
Hi Gordon,

Thanks so much for your help. I think I got this to work partially now.
The Linear Store inside the broker seems to be working, because I see the
below messages:
2015-09-03 15:39:58 [Store] info Linear Store: Most recent persistence id
found: 0x0
2015-09-03 15:39:58 [Store] info Linear Store: Recovered exchange
"topic.xxx"

However, if I create a durable exchange and send durable messages to it,
and then shutdown the broker, and restart the broker. The broker did not
retain those messages. Please see the commands and queue statistics below.
What did I do wrong?

Exchanges don't store messages, they merely route them to any matching bound queues. It is queues which store the messages.

So e.g. if you do:

qpid-config -a localhost:5672 --durable add queue my-queue

and then sent the message to that instead of the exchange, you should see a message in the queue before and after restart (qpid-stat -q).

If you want to keep the publisher sending to an exchange, you can bind a queue to that exchange. This is done automatically if you create a receiver from the exchange, but by default the subscription queue would not be durable. For a durable subscription you would specify "topic.xxx; {link:{name:my-sub,durable:True}}".

./qpid-config -a localhost:5672 --durable add exchange topic topic.xxx
inside the publisher code, I did:
Message msg = Message(s);
msg.setDurable(1);
sender.send(msg);
Aggregate Broker Statistics: (BEFORE shutdown)
   Statistic                   Messages  Bytes
   =============================================
   queue-depth                 0         0
   total-enqueues              3         627
   total-dequeues              3         627
   persistent-enqueues         3         627
   persistent-dequeues         3         627


   Aggregate Broker Statistics: (AFTER shutdown)
   Statistic                   Messages  Bytes
   =============================================
   queue-depth                 0         0
   total-enqueues              0         0
   total-dequeues              0         0
   persistent-enqueues         0         0
   persistent-dequeues         0         0

  Thanks
  jjw


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org

Reply via email to