On 01/08/2010 12:16 PM, denny86 wrote:
Gordon Sim wrote:
Maybe worth asking as an aside at this point why it is you want to
subscribe in unacquired mode? Do you want to acquire every message you
receive? If so the pre-acquired mode will do that more simply and
efficiently.
All i need is to confirm each message received by subscriber with the
broker. i.e, i need a reliable type of communication.
Thats why i turned on ACCEPT_MODE_EXPLICIT.
That is correct, you *do* want ACCEPT_MODE_EXPLICIT for reliable transfer.
Also, i turn on pre-acquired mode, because i thought otherwise there is no
point in explicit acceptance. That broker will de-queue the msg
automatically without getting "accepted" for that.? is that true?
In your first mail you stated you were using ACQUIRE_MODE_NOT_ACQUIRED.
Are you in fact using ACQUIRE_MODE_PRE_ACQUIRED? If so that is what I
was suggesting. In that case you do not need to manually acquire at all.
In fact i turned on once, but i had to remove this, because here also i
faced same problem.
If i turn acquire off, then broker would dequeue that messages, unless and
until it receives "accept" msg only, further that msg is acquired by
subscriber. Thats my understand, please correct me if i am wrong.
Only combination proved me working with no issues and too for multiple queue
listeners, is ACCEPT_MODE_NONE and ACQUIRE_MODE_PRE_ACQUIRED.
>
If there is any other way to setup reliable connection between broker and
subscribers, i would gladly add on to my code.
The default subscription settings give reliable transfer. When used with
a listener auto-ack will only accept messages after the listeners
received() method returns so you often will not need to resort to manual
accepts either (unless you have some need to e.g. release some messages
or if you are using a LocalQueue).
Have you tried with the default subscription settings?
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]