Sunday, June 21, 2020

WSO2 Micro Integrator - Enable Jms transport

Edit file [MI_HOME]/conf/deployment.toml, add below lines:
[[transport.jms.listener]]
name = "myQueueListener"
parameter.initial_naming_factory = "com.ibm.mq.jms.context.WMQInitialContextFactory"
parameter.broker_name = "IBM MQ"
parameter.provider_url = "X.X.X.X:1416/Channel"
parameter.connection_factory_name = "connection_factory_name "
parameter.connection_factory_type = "queue"



[[transport.jms.sender]]
name = "myQueueSender"
parameter.initial_naming_factory = "com.ibm.mq.jms.context.WMQInitialContextFactory"
parameter.broker_name = "IBM MQ"
parameter.provider_url = "X.X.X.X:1416/Channel"
parameter.connection_factory_name = "connection_factory_name "
parameter.connection_factory_type = "queue"


Copying IBM Websphere MQ libraries

These instructions are tested on IBM WebSphere MQ version 8.0.0.4. However, you can follow them for other versions appropriately.
  • Create a new directory named wmq-client , and then create another new directory named lib inside it.
  • Copy the following JAR files from the <IBM_MQ_HOME>/java/lib/ directory (where <IBM_MQ_HOME> refers to the IBM WebSphere MQ installation directory) to the wmq-client/lib/ directory.
com.ibm.mq.allclient.jar
mqcontext.jar
jms.jar
providerutil.jar
  • Create a POM.xml file inside the wmq -client/ directory and add all the required dependencies as shown in the example below.
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>wmq-client</groupId>
<artifactId>wmq-client</artifactId>
<version>8.0.0.4</version>
<packaging>bundle</packaging>
<dependencies>
    <dependency>
        <groupId>com.ibm</groupId>
        <artifactId>fscontext</artifactId>
        <version>8.0.0.4</version>
        <scope>system</scope>
        <systemPath>${basedir}/lib/mqcontext.jar</systemPath>
    </dependency>
    <dependency>
        <groupId>com.ibm</groupId>
        <artifactId>providerutil</artifactId>
        <version>8.0.0.4</version>
        <scope>system</scope>
        <systemPath>${basedir}/lib/providerutil.jar</systemPath>
    </dependency>
    <dependency>
        <groupId>com.ibm</groupId>
        <artifactId>allclient</artifactId>
        <version>8.0.0.4</version>
        <scope>system</scope>
        <systemPath>${basedir}/lib/com.ibm.mq.allclient.jar</systemPath>
    </dependency>
    <dependency>
        <groupId>javax.jms</groupId>
        <artifactId>jms</artifactId>
        <version>1.1</version>
        <scope>system</scope>
        <systemPath>${basedir}/lib/jms.jar</systemPath>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>2.3.4</version>
            <extensions>true</extensions>
            <configuration>
                <instructions>
                    <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                    <Bundle-Name>${project.artifactId}</Bundle-Name>
                    <Export-Package>*;-split-package:=merge-first</Export-Package>
                    <Private-Package/>
                    <Import-Package/>
                    <Embed-Dependency>*;scope=system;inline=true</Embed-Dependency>
                    <DynamicImport-Package>*</DynamicImport-Package>
                </instructions>
            </configuration>
        </plugin>
    </plugins>
</build>
</project>
  • Navigate to the wmq -client directory using your Command Line Interface (CLI), and execute the following command, to build the project: mvn clean install
  • Stop the WSO2 Micro Integrator, if it is already running.
  • Remove any existing IBM MQ client JAR files from the MI_HOME/dropins directory and the MI_HOME/lib directory.
  • Copy the <wmq-client>/target/wmq-client-8.0.0.4.jar file to the MI_HOME/dropins directory.
  • Download the jta.jar file from the maven repository, and copy it to the MI_HOME/lib directory.
Reference: https://ei.docs.wso2.com/en/7.1.0/micro-integrator/setup/brokers/configure-with-IBM-websphereMQ

No comments:

Post a Comment

Install and use xorg-server on macOS via Homebrew

  The instructions to install and use xorg-server on macOS via Homebrew: Install Homebrew (if you haven't already): /bin/bash -c ...