> Is there a way in Apache Artemis to configure or adjust the connection closure mechanism to achieve behavior similar to transport.closeAsync=false in ActiveMQ?
The sync vs. async closing functionality in ActiveMQ Classic was implemented via AMQ-1739 [1] due to the broker's consumption of a large number of file descriptors (via open sockets) in certain situations. Furthermore, the documentation [2] only recommends setting transport.closeAsync=false if you're afraid of "running out of available sockets owing to the rapid cycling of connections." ActiveMQ Artemis' architecture is different as it is fundamentally non-blocking so the chances of running out of sockets is _greatly_ diminished. Therefore, such a setting to mitigate running out of sockets has never been required. > Can anyone suggest methods or practices for ensuring synchronous connection closure in Apache Artemis that could help maintain the sequence and reliability of message processing? As noted previously, this setting in ActiveMQ Classic is to help prevent the broker from running out of sockets, but you describe the issue as being related to "the sequence and reliability of message processing." At this point I don't see how either one of these things could be a problem in ActiveMQ Artemis. Do you have a test which demonstrates an issue? Could you clarify exactly what you mean by "the sequence and reliability of message processing?" > If anyone has faced a similar challenge or can share their experience with implementing such configurations in Artemis, I would be grateful for any information or recommendations. I've been working with this code-base for almost a decade and I can't recall anybody having a problem with the timing of connection closures. It's worth noting that the use-case for which this functionality was implemented in ActiveMQ Classic (i.e. "the rapid cycling of connections") is generally considered anti-pattern. If you have a client that is connecting and disconnecting so often that it's causing problems for the broker then you might consider changing your client to behave better. The broker can only do so much to protect itself for ill-behaving clients like this. Justin [1] https://issues.apache.org/jira/browse/AMQ-1739 [2] https://activemq.apache.org/tcp-transport-reference.html On Tue, Feb 6, 2024 at 8:08 AM Romul Fobos <romulfo...@gmail.com> wrote: > Greetings, esteemed colleagues, > > I am in the process of migrating a service from the Apache ActiveMQ message > broker to Apache Artemis and have encountered a specific challenge related > to connection management. In ActiveMQ, I utilized the > transport.closeAsync=false parameter in the transportConnector > configuration to ensure synchronous socket closure between the client and > the broker. This parameter was critical for ensuring resilience and > consistency in message processing within our system. > > Transitioning to Apache Artemis, I noticed that there doesn't seem to be a > direct analogue to the transport.closeAsync parameter. It appears that > Artemis closes connections asynchronously by default, which could > potentially impact the behavior of our application. > > My questions to the community are: > > Is there a way in Apache Artemis to configure or adjust the connection > closure mechanism to achieve behavior similar to transport.closeAsync=false > in ActiveMQ? > Can anyone suggest methods or practices for ensuring synchronous connection > closure in Apache Artemis that could help maintain the sequence and > reliability of message processing? > If anyone has faced a similar challenge or can share their experience with > implementing such configurations in Artemis, I would be grateful for any > information or recommendations. > Thank you in advance for your time and assistance. >