Your application is really in control of shutting itself down gracefully. The main thing to do is to invoke stop() [1] on the Connection. That will halt delivery of any further messages to your consumers. Perhaps this is the magic method you were looking for.
Any active consumers can complete their processing and send their replies and then the application can shut down. You may be interested in ARTEMIS-5093 [2] as it is relevant for the stopping case as well as the closing case. Justin [1] https://docs.oracle.com/javaee/7/api/javax/jms/Connection.html#stop-- [2] https://issues.apache.org/jira/browse/ARTEMIS-5093 On Sat, Nov 30, 2024 at 2:51 PM John Lilley <john.lil...@redpointglobal.com> wrote: > Our software mostly consists of RPC services which receive requests on a > named queue and post replies to the reply-to queue of the message. We are > using the JMS Artemis driver version 2.32.0. > > There are times when we want a service to shutdown gracefully, meaning > > * Stops receiving new requests > * Finishes processing in-flight requests and posts responses to > reply-to queues (and ACKs messages) > * Quits the service > > What is the correct sequence to do this? IIRC we can't just stop a > Consumer when it might be processing a request or we get errors. I'm > hoping there is some kind of suspend() or shutdown() call that still allows > in-flight requests to complete. > > Thanks > John > > PLEASE NOTE: This e-mail from Redpoint Global Inc. ("Redpoint") is > confidential and is intended solely for the use of the individual(s) to > whom it is addressed. If you believe you received this e-mail in error, > please notify the sender immediately, delete the e-mail from your computer > and do not copy, print or disclose it to anyone else. If you properly > received this e-mail as a customer, partner or vendor of Redpoint, you > should maintain its contents in confidence subject to the terms and > conditions of your agreement(s) with Redpoint. >