posted 18 years ago
Hi,
I have an application acting containing a number of different JMS Listeners for different services that we offer. I want to make services configurable so that the acknowledgement mode for some services is AUTO_ACKNOWLEDGE while for others it's CLIENT_ACKNOWLEDGE (if certain types of exceptions occur then I'll place message back on queue by calling Session.recover()). This isn't a problem as I use different Sesison objects per service.
However, on my producer side I currently just use a single JMS Session object to create all my queues and JMS Senders. As message acknowledgement is set on the Session I don't want to have to have a different Session object per queue (per Service really). I'm wondering is it enough for producer Session object to be created using AUTO_ACKNOWLEDGE and for my consumer Session objects to be created using the "correct" acknowledgement mode?
That is, it's to me why the JMS Producer needs to also set the acknowledgement code - is it not just enough for the consumer?
Thanks,
Aoife