Supporting Different Transports¶
Follow the relevant section for the steps that need to be carried out before using the required transport to receive and publish events via the WSO2 Integrator: SI.
Kafka transport¶
To enable the WSO2 Integrator: SI to receive and publish events via the Kafka transport, follow the steps below:
-
Download the Kafka broker from the Kafka site.
-
Convert and copy the Kafka client jars from the
<KAFKA_HOME>/libsdirectory to the<SI_HOME>/libdirectory as follows:-
Create a directory in a preferred location in your machine and copy the following JARs to it from the
<KAFKA_HOME>/libsdirectory.Info
This directory is referred to as the
<SOURCE_DIRECTORY>in the next steps.kafka_2.11-0.10.2.1.jarkafka-clients-0.10.2.1.jarmetrics-core-2.2.0.jarscala-library-2.11.8.jarscala-parser-combinators_2.11-1.0.4.jarzkclient-0.10.jarzookeeper-3.4.9.jar
-
Create another directory in a preferred location in your machine.
Info
This directory is referred to as the
<DESTINATION_DIRECTORY>in the next steps. -
To convert all the Kafka jars you copied into the
<SOURCE_DIRECTORY>, issue one of the following commands.- For Windows::
<SI_HOME>/bin/jartobundle.bat <SOURCE_DIRECTORY_PATH> <DESTINATION_DIRECTORY_PATH> - For Linux:
<SI_HOME>/bin/jartobundle.sh <SOURCE_DIRECTORY_PATH> <DESTINATION_DIRECTORY_PATH>
- For Windows::
-
Copy the converted files from the
<DESTINATION_DIRECTORY>to the<SI_HOME>/libdirectory. -
Copy the jars that are not converted from the
<SOURCE_DIRECTORY>to the<SI_HOME>/samples/sample-clients/libdirectory.
-
-
The Kafka server should be started before sending events from the WSO2 Integrator: SI to a Kafka consumer.
JMS transport¶
To configure the Apache ActiveMQ message broker, follow the steps below:
-
Install Apache ActiveMQ JMS.
Info
This guide uses ActiveMQ versions 5.7.0 - 5.9.0. If you want to use a later version, for instructions on the necessary changes to the configuration steps, go to Apache ActiveMQ Documentation.
-
Download the
activemq-client-5.x.x.jarfrom here. -
Register the
InitialContextFactoryimplementation according to the OSGi JNDI spec and copy the client jar to the<SI_HOME>/libdirectory as follows.-
Navigate to the
SI_HOME>/bindirectory and issue the following command.- For Linux:
./icf-provider.sh org.apache.activemq.jndi.ActiveMQInitialContextFactory <Downloaded Jar Path>/activemq-client-5.x.x.jar <Output Jar Path> - For Windows:
./icf-provider.bat org.apache.activemq.jndi.ActiveMQInitialContextFactory <Downloaded Jar Path>\activemq-client-5.x.x.jar <Output Jar Path>
Info
If required, you can provide privileges via
chmod +x icf-provider.(sh|bat).Once the client jar is successfully converted, the
activemq-client-5.x.xdirectory is created. This directory contains the following:activemq-client-5.x.x.jar(original jar)activemq-client-5.x.x_1.0.0.jar(OSGi-converted jar)
In addition, the following messages are logged in the terminal.
INFO: Executing 'jar uf <absolute_path>/activemq-client-5.x.x/activemq-client-5.x.x.jar -C <absolute_path>/activemq-client-5.x.x /internal/CustomBundleActivator.class' [timestamp] org.wso2.carbon.tools.spi.ICFProviderTool addBundleActivatorHeader - INFO: Running jar to bundle conversion [timestamp] org.wso2.carbon.tools.converter.utils.BundleGeneratorUtils convertFromJarToBundle - INFO: Created the OSGi bundle activemq_client_5.x.x_1.0.0.jar for JAR file <absolute_path>/activemq-client-5.x.x/activemq-client-5.x.x.jar - For Linux:
-
Copy
activemq-client-5.x.x/activemq-client-5.x.x.jarand place it in the<SI_HOME>/samples/sample-clients/libdirectory. -
Copy
activemq-client-5.x.x/activemq_client_5.x.x_1.0.0.jarand place it in the<SI_HOME>/libdirectory.
-
-
Create a directory in a preferred location in your machine and copy the following JARs to it from the
<ActiveMQ_HOME>/libsdirectory.Info
This directory is referred to as the
<SOURCE_DIRECTORY>in the next steps.hawtbuf-1.9.jargeronimo-jms_1.1_spec-1.1.1.jargeronimo-j2ee-management_1.1_spec-1.0.1.jar
-
Create another directory in a preferred location in your machine.
Info
This directory will be referred to as the
<DESTINATION_DIRECTORY>in the next steps. -
To convert all the Kafka jars you copied into the
<SOURCE_DIRECTORY>, issue the following command.- For Windows:
<SI_HOME>/bin/jartobundle.bat <SOURCE_DIRECTORY_PATH> <DESTINATION_DIRECTORY_PATH> - For Linux:
<SI_HOME>/bin/jartobundle.sh <SOURCE_DIRECTORY_PATH> <DESTINATION_DIRECTORY_PATH>
- For Windows:
-
Copy the converted files from the
<DESTINATION_DIRECTORY>to the<SI_HOME>/libdirectory. -
Copy the jars that are not converted from the
<SOURCE_DIRECTORY>to the<SI_HOME>/samples/sample-clients/libdirectory.
MQTT transport¶
To configure the MQTT message broker, follow the steps below:
-
Download the
org.eclipse.paho.client.mqttv3-1.1.1.jarfile from here. -
Place the file you downloaded in the
<SI_HOME>/libdirectory.
RabbitMQ transport¶
To configure the RabbitMQ message broker, follow the steps below:
-
Download RabbitMQ from here.
-
Create a directory in a preferred location in your machine. This directory is referred to as at the
<SOURCE_DIRECTORY>in the rest of the procedure. -
Copy the following files from the
<RabbitMQ_HOME>/pluginsdirectory to the<SOURCE_DIRECTORY>you created. -
Create another directory in a preferred location in your machine. This directory is referred to as the
<DESTINATION_DIRECTORY>in this procedure.