Activemq's port monitoring introduction and port optimization

In activemq's conf/activemq.xml main configuration file, there is such a paragraph, as shown in the figure:

wKioL1hOO8GREhQQAAEBIUDtPqU599.png

 

The transportConnectors field in this figure is the regulation of mq for each network protocol port. As can be seen from the figure, the access port used by the name openwire is 61616, and the access port number of the name amqp is 5672. The value in the name is written casually, and it will also be reflected in the web Connections interface of mq, and 0.0.0.0 means all devices on the machine. Note that 127.0.0.1 or localhost cannot be written here. In this way, mq is Unable to connect to the Internet. Looking further back, it is also stipulated that the maximum number of links for the port corresponding to the name is 1000, and wireFormat.maxFrameSize means "the size of a complete message", which is 100M here.

 

Here to add, Activemq's default message protocol is openwire, which is tcp.

 

In the "transportConnector" tag, in addition to the mandatory "name" attribute and "uri" attribute, there are some optional attributes, such as: enableStatusMonitor, updateClusterClients. For detailed attribute introduction, please refer to the introduction in the "Server side options" section in the official documentation http://activemq.apache.org/configuring-transports.html.

 

In activemq 5.13.x, apache company simplified this paragraph and turned it into the following.

wKioL1hOPwegzhz7AAApmMEnsFQ441.png

Those seventy-eighty-eighty protocols are unified into one auto, and the settings for a single protocol are also a hodgepodge. Such a setting does not specify the network listening port of activemq, so it uses the BIO network IO model by default, and for the tcp-based network architecture, we should specify that the NIO network model is to be used, so we change the configuration as follows:


wKioL1hOQIDzR7B-AAAoLpQHMg8097.png

After this change, only the tcp protocol can pass, what if there are other protocols besides tcp?

 

wKioL1hORXfjoFpuAAAWhQFGPfM762.png

Change it to this.

 

If in order to show the force and make your mq stronger, we should also add the following fields:

1
<transportConnector name= "auto+nio"  uri= "auto+nio://0.0.0.0:61608?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600&amp;org.apache.activemq.transport.nio.SelectorManager.corePoolSize=20&amp;org.apache.activemq.transport.nio.SelectorManager.maximumPoolSize=50"  />

 

The number of core worker threads and the maximum number of worker threads in the thread pool used by NIO are additionally set here.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326184910&siteId=291194637