First, introduce
What is ACTIVEMQ's transport connectors?
ACTIVEMQ is a messaging server. As a messaging server, there will be producers and consumers to use it. The producer sends the message to ACTIVEMQ and the consumer takes the message from ACTIVEMQ. Therefore, both the producer and the consumer need to establish a connection with ACTIVEMQ to exchange messages. both the producer and the source can be regarded as ACTIVEMQ's client
ACTIVEMQ provides a number of ways for the client to connect to it. For example, the client can use TCP, UDP, SSL, HTTP and many other ways to connect to the ACTIVEMQ, these connections are: Transport connectors
Because the TCP connection method is used in the project, it mainly records some related knowledge of TCP Transport connector.
Two, TCP Transport Connector
To connect, you need an address (URI) to configure the TCP connection URI in the following format:
The query section can take many parameters, which are the transport Options, which can set some of the behavior of the underlying TCP transport: for example, the connection timeout, the queue size of the TCP connection .... More transport options can be found on the website
Because ACTIVEMQ supports a number of different connection modes, it is possible to see the relevant configuration in its configuration file. The configuration file is Conf/activemq.xml. Here is the configuration file of the activemq I used:
As you can see, the above configuration file indicates that: ACTIVEMQ supports various connection protocols: Tcp,amqp,stomp ... In fact, this does not conflict with the above mentioned SSL, HTTP, SSL, HTTP is only the lower level.
For specific descriptions of each protocol, refer to:
Messages are passed in the form of a byte stream between the networks. Therefore, the need to serialize the message, the TCP form of the connector, how is it serialized?
The serialized format is defined by the wire protocol. For example, in the Openwire. For more information on wire protocols, refer to the official documentation
How messages was serialized from and to a byte-sequence was defined by the wire protocol. The TCP Transport connector is used to exchange messages serialized to openwire wire format over the TCP network.
ActiveMQ Transport Connectors