Skip to content

Home

Introduction

Development

IDEs

Services

Service manager

API Explorer

ActiveMQ transport connectors

Transport connectors define the means (protocol) by which clients connect to brokers. By adding more transport connectors, we can broaden the means by which clients can connect to TORO Integrate's embedded ActiveMQ broker. Transports such as AMQP, MQTT, STOMP, and others can be configured in addition to the default TCP and VM transports that come with TORO Integrate out-of-the-box, as a need for a new transport arises.

ActiveMQ-specific configuration

Transport connectors are used exclusively by ActiveMQ brokers.

To add, modify, or delete transport connectors, the XML configuration file of the ActiveMQ broker must be modified. This configuration file can be found under <toro-integrate-home>/conf/broker/activemq-embedded.xml.

Adding a transport connector

Adding a transport connector can be done by following these steps:

  1. Open the activemq-embedded.xml file, then look for the XML element <amq:transportConnectors> under the <amq:broker> element. This section is responsible for configuring the transport connectors of the embedded ActiveMQ.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    <amq:broker>
       ...
        <!-- Transport connectors -->                
        <amq:transportConnectors>
            <amq:transportConnector uri="vm://localhost"/>
            ...
        </amq:transportConnectors>
        ...
    </amq:broker>
    
  2. To add a new transport connector, simply add a new <amq:transportConnector> element to the list. This element requires a uri attribute and an optional name attribute. For example, <amq:transportConnector uri="vm://localhost"/> defines a VM transport connector and because this transport connector is defined by default, it comes shipped out-of-the-box with TORO Integrate's embedded ActiveMQ.

    1
    2
    3
    4
    5
    6
    7
    8
    <amq:transportConnectors>
        <amq:transportConnector uri="vm://localhost"/>
        <amq:transportConnector uri="${jms.url}"/>
        ...
        <!-- MQTT transport connector -->
        <amq:transportConnector uri="mqtt://localhost:1883"/>
        ...
    </amq:transportConnectors>
    

    Pre-populated configurations

    For convenience, there are pre-populated samples for common transports such as MQTT, NIO, AMQP, and others included in the activemq-embedded.xml file. Simply uncomment the transport connector that you want to use and you're good to go. The transport connectors you can add is not limited to the pre-populated samples. Refer to ActiveMQ's documentation for more information.

  3. Save the file.

  4. Restart TORO Integrate to see the changes reflected.

Editing a transport connector

Similar to adding, editing a transport connector is simply done by modifying the existing <amq:transportConnector> elements. The affected TORO Integrate instance must be restarted after changes in activemq-embedded.xml have been saved in order to reflect updates made.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
...
<amq:transportConnectors>
    <amq:transportConnector uri="vm://localhost"/>
    <amq:transportConnector uri="${jms.url}"/>
    ...
    <!-- MQTT transport connector -->
    <amq:transportConnector uri="mqtt://localhost:1884" name="mqtt"/>
    ...
</amq:transportConnectors>
...

Removing a transport connector

As with the previous sections, removing a transport connector is done by removing the corresponding <amq:transportConnector> element of the transport connector that you no longer need. Commenting the XML element would also do the trick; in fact, this is recommended if there are any chances in the future you might need the transport connector back.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
...
<amq:transportConnectors>
    <amq:transportConnector uri="vm://localhost"/>
    <amq:transportConnector uri="${jms.url}"/>
    ...
    <!-- MQTT transport connector -->
    <!-- <amq:transportConnector uri="mqtt://localhost:1884" name="mqtt"/> -->
    ...
</amq:transportConnectors>
...

Before you migrate...

If you're using an embedded instance of ActiveMQ and have decided to switch over to a stand-alone version instead, the existing transport connectors would not be automatically migrated over. You will have to copy your existing configuration in order to carry your settings over.