24.12.11

ActiveMQ in Actionve–Transport Connectors

  • In order to exchange messages, producers and consumers (clients) need to connect to the broker. This client-to-broker communication is performed through transport connectors.

Unfortunately, when I tried to search “Transport Connectors” from the Internet, I didn’t find a similar definition for it.

There is a class, TransportConnector, implemented in ActiveMQ. Anything I found about transport connectors, they are related to the broker configuration.

  • From the broker’s perspective, the transport connector is a mechanism used to accept and listen to connections from clients.

This makes sense to me. So, from the JMS client’s perspective, Transport Connectors are used for connecting to the brokers, while from the broker’s perspective, configuring the Transport Connectors is configuring the binding address for providing services for the clients.

  • <transportConnectors><transportConnector>…</transportConnector></transportConnectors>
  • <transportConnector name=”openwire” uri=”tcp://localhost:61616” discoveryUri=”multicase://default” />
    • name: The configuration for a connector must uniquely define the name.
    • uri: The configuration for a connector must uniquely define the URI attributes.
      • Network protocol
      • optional parameters
    • discoveryUri
      • Is Optional
  • <transportConnector name=”ssl” uri=”ssl://localhost:61617” />
  • <transportConnector name=”stomp” uri=”stomp://localhost:61613” />
  • <transportConnector name=”xmpp” uri=”xmpp://localhost:61222” />

XMPP is not supported by activemq-core.
SSL connector need certificate configuration.

  • From the client’s perspective, the Transport Connector URI is used to create a connection to the broker in order to send and receive messages.
  • ActiveMQConnectionFactory factory
    • = new ActiveMQConnectionFactory(“tcp://localhost:61616”);

Recently, I made a very stupid mistake for the transport connector concept. Now I won’t have that problem any more.

No comments: