ActiveMQ NIO Configuration

I am exploring the possibility of switching from tcp to nio in ActiveMQ. The documentation gives an example of this, in which only the URI configuration changes in the xml broker configuration:

<broker> ... <transportConnectors> <transportConnector name="nio" uri="nio://0.0.0.0:61616"/> </<transportConnectors> ... </broker> 

Question:. Do I need to also change the client configuration scheme? For instance,

 <amq:connectionFactory id="jmsConnectionFactory" brokerURL="nio://localhost:61616?"/> 

This seems like a source of confusion for others too:

These threads claim that NIO needs to be configured only for the broker, but is there official documentation to support this? Thanks.

+4
source share
1 answer

You do not need to change the client from tcp or somehow to NIO, the broker is the only party that will use or have any benefit from NIO, since the client supports one open connection. Even if you make changes to NIO, the code is smart enough to know that the client is requesting NIO and swaps in the TCP factory, so in the end you will still get the same thing.

+4
source

Source: https://habr.com/ru/post/1446011/


All Articles