Beliebte Suchanfragen

Cloud Native

DevOps

IT-Security

Agile Methoden

Java

|
//

WebSphereMQ Integration using Mule ESB Community Edition

11.3.2011 | 1 minutes of reading time

Mule ESB is an open source implementation of an enterprise service bus. In contrast to the free Community Edition, Mule’s commercial Enterprise Edition provides integration of WebSphereMQ servers out of the box. This article explains how to integrate a WebSphereMQ server as a JMS provider by means of the Community Edition.

First, add the following JARs holding the WebSphereMQ client API to Mule’s classpath:

  • com.ibm.mq.jar
  • com.ibm.mqjms.jar
  • dbhcore.jar

These JARs are provided with the installation of your WebSphereMQ server. Alternatively, they can be taken from the free WebSphereMQ client distribution. Note that the client distribution does not support XA transactions. Copy these JARs to

1$MULE_HOME/lib/opt

To configure the connection to your WebSphereMQ system, you need to to know the following parameters:

– IP/ host name
– TCP port number
– Name of the Queue manager
– Name of the MQ channel
– User / Password

The Mule JMS connector is set up like this:

1<jms:connector
2   name="WebsphereMQConnector"
3   connectionFactory-ref="MQConnectionFactory"
4   specification="1.0.2b"
5   username="mquser"
6   password="password"
7   numberOfConsumers="1"/>
8<spring:bean
9   id="MQConnectionFactory"
10   class="com.ibm.mq.jms.MQQueueConnectionFactory">
11   <spring:property name="transportType" value="1"/>
12   <spring:property name="hostName" value="localhost"/>
13   <spring:property name="port" value="1414"/>
14   <spring:property name="channel" value="MY.CHANNEL"/>
15   <spring:property name="queueManager" value="MY.QM"/>
16</spring:bean>

To use the namespaces “jms” and “spring” you have to declare them in the root element of your mule-config.xml. Assuming you are using Mule 3.0, it may look like this:

1<mule xmlns="http://www.mulesoft.org/schema/mule/core"
2       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3       xmlns:spring="http://www.springframework.org/schema/beans"
4       xmlns:jms="http://www.mulesoft.org/schema/mule/jms"
5    xsi:schemaLocation="
6       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
7       http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.0/mule.xsd
8       http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/3.0/mule-jms.xsd">

Having done this, the WebSphereMQConnector can be used to define JMS endpoints, e.g.

1<endpoint 
2   name="MyInQueue"   
3   address="jms://queue:MY.QUEUE.IN"
4   connector-ref="WebsphereMQConnector"/>
5...
6<flow id="MyFlow">
7   <inbound-endpoint ref="MyInQueue" />
8   ...
9</flow>

JMS consumers need at least the GET, INQ and BROWSER privileges for queues they want to read from. A detailed explanation is given here . JMS producers need the PUT privilege.

Conclusion: as long as your queues do not partcipate in XA transactions, the free Community Edition of Mule ESB is sufficient to integrate a WebSphereMQ server as an external JMS provider.

|

share post

Likes

0

//

More articles in this subject area

Discover exciting further topics and let the codecentric world inspire you.

//

Gemeinsam bessere Projekte umsetzen.

Wir helfen deinem Unternehmen.

Du stehst vor einer großen IT-Herausforderung? Wir sorgen für eine maßgeschneiderte Unterstützung. Informiere dich jetzt.

Hilf uns, noch besser zu werden.

Wir sind immer auf der Suche nach neuen Talenten. Auch für dich ist die passende Stelle dabei.