On 01/08/2010 12:42 PM, denny86 wrote:
Gordon Sim wrote:
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.
Initially, i set to ACQUIRE_MODE_NOT_ACQUIRED and ACCEPT_MODE_EXPLICIT only.
But if i do ACQUIRE_MODE_PRE_ACQUIRED and ACCEPT_MODE_EXPLICIT combination,
will i get reliable transfer? ie, for eg, if i lost a message, then will i
get in the next try, provided publisher and broker is running with no
issues?
Yes, messages will only be dequeued once accepted (and even if you set
autoAck to a non-zero value they will never be accepted until your
listener has processed them). So if the connection or client is killed
then unaccepted messages will be redelivered on re-subscribing.
Gordon Sim wrote:
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?
No, i left two fields - autoAck and flow control. Only used this
ACQUIRE_MODE_NOT_ACQUIRED and ACCEPT_MODE_EXPLICIT as subscription
parameters.
Ok, so if autoAck is non-zero then accepts will be handled for you.
Also i am confused with sub settings, should i configure subscription
settings through SubscriptionManager class OR SubscriptionSettings Class? I
have done the former one
The simplest way (in my view) is to pass in an instance of
SubscriptionSettings to each SubscriptionManager::subscribe() call.
However if the default settings work for you (and it sounds like they
might?) then you don't even need to do that. Just call subscribe with
your listener and the queue name.
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]