ActiveMQ Transport Protocol

Configuration

ActiveMQ installation directory conf/activemq.xmlis <transportConnectors>within the label.

Configuration Example

TCP (the default protocol, performance is relatively reliable)

Transmission Control Protocol(TCP)

  1. This is the default Broker configuration, TCP Client listening port of 61616
  2. Before the data transmission network, it is necessary to serialize the data, the message is called by a wire into a byte stream protocol of the sequence. By default, ActiveMQ the wire protocol is called OpenWire, its purpose is to promote efficiency and fast interactive data on a network.
  3. URI form TCP connections such as: tcp://localhost:port?key=value&key=value(the latter parameter is optional)
  4. TCP transport advantages:
    • TCP transmission protocol of high reliability, high stability
    • Efficiency: the byte stream the efficiency is very high
    • Effectiveness, availability: a wide range of applications, support for any platform
<transportConnectors>
    <transportConnector name="tcp" uri="tcp://localhost:61616?trace=true"/>
</transportConnectors>

NIO (TCP optimization and expansion based, high scalability)

New On / Notebooks Protocol (specifically)

  1. NIO protocol and TCP protocol similar, but more focused on the NIO underlying access operation. It allows developers to have more of the same resource can call the client and server have more load.
  2. For the scene using the NIO protocol:
    • There may be a large number of Client to connect to the Broker, in general, to a large number of Client Connection Broker is the operating system thread limit. Therefore, NIO implementation to run over TCP requires fewer threads, it is recommended to use NIO agreement
    • There may be a very slow network transmission for Broker, NIO provide better performance than TCP.
  3. NIO connection URI form: nio//localhost:port?key=value
<transportConnectors>
    <transportConnector name="nio" uri="nio://localhost:61618?trace=true"/>
</transportConnectors>

UDP (performance than TCP, but does not have the reliability)

User Datagram Protocol(UDP)

  1. The difference between UDP and TCP
    • TCP is a stream of original transfer agreement means that the packet is guaranteed, in other words, the data packets are lost and will not be copied. The UDP, a further aspect, it is not guaranteed delivery of packets.
    • TCP is a stable and reliable packet delivery protocol, meaning that data is not lost in the delivery process. This ensures that the transmission and reception is possible between the reliable delivery. Instead, UDP protocol is just a link, so it does not say the reliability.
  2. TCP is used in a stable and reliable used in the scene; the UDP is typically used in fast data transfer and data loss scenario afraid
  3. UDP connection URI form:udp://localhost:port?key=value
<transportConnectors>
     <transportConnector name="udp" uri="udp://localhost:61618?trace=true"/>
</transportConnectors>

SSL (Secure Link Protocol)

Sockets Layer Protocol Secure (SSL)
the URL of the form of connection:ssl://localhost:port?key=value

<transportConnectors>
      <transportConnector name="ssl" uri="ssl://localhost:61618?trace=true"/>
</transportConnectors>

HTTP/HTTPS

HyperText Transfer Protocol(HTTP/HTTPS)

  1. web and email services such as the need to access through the firewall, Http can use this occasion
  2. Connection URI form:http://localhost:port?key=value
<transportConnectors>
    <transportConnector name="http" uri="http://localhost:8080?trace=true"/>
</transportConnectors>

VM

VM Protocol(VM)

  1. VM transport allows internal communications VM, avoiding the overhead of the network. This connection is not used when a socket connection, but the direct method calls.
  2. The first customers will be connected to create a VM start a embed VM broker, followed by all using the same connection broker name of the VM will use the broker, when all connections are closed on the broker, when the broker will automatically shut down.
  3. Connection URI form: vm://brokerName?key=value

Guess you like

Origin www.cnblogs.com/loveer/p/11407194.html