SubscriptionManager subscriptions(session);
      // Create a listener and subscribe it to the queue named "message_queue"
      Listener listener(subscriptions);
      // Receive messages until the subscription is cancelled
      // by Listener::received()
      LocalQueue lq;
      subscriptions.start();
      subscriptions.setAutoStop(false);
      SubscriptionSettings settings;
      settings.completionMode = COMPLETE_ON_ACCEPT;
      settings.acceptMode = ACCEPT_MODE_EXPLICIT;
      settings.autoAck = 0;
      settings.flowControl = FlowControl::unlimited();

      Subscription sub1 = subscriptions.subscribe(lq, "message_queue",
settings, "lq");
      Message m = lq.pop();
      sub1.cancel();
      sleep(5);

      subscriptions.subscribe(listener, "message_queue", "listener");
      subscriptions.wait();


When I do this I get no messages on my listener and subscriptions just
exits.  If I do a while(sleep) instead of the wait, I still never see
my message.  Even if I make 2 connections and 2 sessions and 2
subscriptionManagers and run them both I still don't see messages on
the listener.

Am I doing something wrong?

Thanks,

Adam

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to