Friday 30 September 2016

create JMS Bridge between WLS and IBM Websphere MQ


Steps to create JMS Bridge between WLS and IBM Websphere MQ

 

 

Below are the steps to create JMS Bridge between WLS and IBM Websphere MQ :

.

The steps are related to my local settings,where I have my WLS and IBM websphere MQ Installed(doesnt matter if MQ is on a remote machine).

.

So kindly change accordingly to your setup.

.

1.Go to your IBM websphere MQ Install installation folder(C:\Program Files\IBM\WebSphere MQ)

.

2.Inside:C:\Program Files\IBM\WebSphere MQ  you will see java folder

.

3.copy the java folder to some other location eg D:\xxxx\Java

.

4.open JMSAdmin.config inside D:\xxxx\Java\bin

.

5.We have change two things here INITIAL_CONTEXT_FACTORY and PROVIDER_URL

I have set them to

INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory

PROVIDER_URL=file:/C:/JNDI-Directory

dont forget to comment the other INITIAL_CONTEXT_FACTORY and PROVIDER_URL

.

6.Save the changes

.

7.Inside D:\xxxx\Java\bin you can find JMSAdmin.bat, start that

.

8.Type dis ctx, to check this there any Bindings

Initially you will not see anything here

MQ Configuration

.

9.Start–> All Programs –> IBM WebSphere MQ –> WebSphere MQ Explorer

.

10.Create QueueManager TESTQM (analogous to a JMS Server in WebLogic) , there will 4 steps, its straight forward to follow,Set the listener port.

By default MQ uses 1414 which can be overridden by user

.

11.After creating the Queue Manager (QM) verify if the QM is started (Green Up Arrow)

.

12.Now create the Queue TestQ. Right clicking on queue and New

.

13.Create a Server Connection Channel (the closest one in WebLogic JMS is Connection factory)

click on channels New, provide channel name

.

14.This finishes the configuration.

.

15. now got to JMSAdmin.bat window which you opened on step 7

.

16. type: define xaqcf(ConnFact) and give enter

.

17. again type : define q(JNDI) queue(Queue name)

.

19. Login to weblogic admin console

(I have given my config details you can manually created them from console)

.

20. create JMS server

JMSServer

AdminServer

.

21. create JMS Module

SystemModule

AdminServer

JMSServer

AdminServer

Queue

JMSServer

TestQ

JMSServer

jms/SystemModule-jms.xml

.

22. Create Bridge Destination

WLSDestination

eis.jms.WLSConnectionFactoryJNDIXA

ConnFact

t3://localhost:7001

QueueInnu

MQDestination

eis.jms.WLSConnectionFactoryJNDIXA

ConnFact

com.sun.jndi.fscontext.

RefFSContextFactory

file:/D:/Magesh/JDNI-Directory

Innu_Q

.

23. Create Bridge

Bridge-0

AdminServer

WLSDestination

MQDestination

Exactly-once

true

.

24.finally we need to add MQ jar files in WLs startup script

com.ibm.mq.fta.jar;com.ibm.mq.jar;com.ibm.mq.jms.Nojndi.jar;com.ibm.mqetclient.

jar;com.ibm.mqjms.jar;commonservices.jar;connector.jar;fscontext.jar;jms.jar;jndi.jar;jta.jar;

providerutil.jarrmm.jar;

You will find these jar’s inside  D:\xxxx\Java\lib

.

25. After these we are successfully created JMS bridge between WLS and IBM Websphere, you can test this by sending a message to WLS Queue, this message can also be view on IBM MQ.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

JMS bridge between Weblogic and MQ series example

Some Advantages of having a JMS bridge between Weblogic and MQ series listener is even though the destination application is down, bridge will manage the messages by its built in capacity.

Bridge has capacity of retry, transaction management.

When destination application has some downtime bridge will cache the messages and re-send it when the destination application comes up.

It will automatically detect start/stop of destination application.

It is guaranteed delivery pattern

 

Process for creating the JMS bridge.

 Login to Weblogic console through browser

Create a queue required for collection of messages from source end(QueueJndi).

 navigate Services → Messaging → Bridges → JMS Bridge Destinations(click new)

first time you will get few properties only, fill them and then edit the destination again to refill the remaining properties.

 Name                                             Value

 Name                                             sourceDestinationQueue

 Adapter JNDI Name                    eis.jms.WLSConnectionFactoryJNDIXA

 Classpath

 Connection                                     URL t3://[host]:[port]{ex t3://localhost:7001}

 Initial Context Factory                  weblogic.jndi.WLInitialContextFactory

 Connection Factory JNDI Name  JMSCF_JNDI

 Destination JNDI Name               QueueJndi

 Destination Type                            Queue

 User Name                                     [weblogic username]

 User Password                               [password for the user]

 Confirm User Password                 [same as above password

Click Save

 navigate Services → Messaging → Bridges → JMS Bridge Destinations(click new)

 first time you will get few properties only, fill them and then edit the destination again to refill the remaining properties.

 Name                                             Value

 Name                                              targetDestinationQueue

 Adapter JNDI Name                     eis.jms.WLSConnectionFactoryJNDIXA

 Classpath

 Connection                                     [JMS.BROKER.URL]from destination→ configuration

 Initial Context Factory           org.apache.activemq.jndi.ActiveMQInitialContextFactory

 Connection Factory JNDI Name  QueueConnectionFactory

 Destination JNDI Name               dynamicQueues/daEventQueue

 Destination Type                           Queue

 User Name                                     [tomcat username]

 User Password                               [tomcat password for the user]

 Confirm User Password                [same as above password]

Click save

navigate Services → Messaging → Bridges

click new

Name                                   Value

Name                                   JMS-MQ-Bridge

selector

Quality Of Service              Atmost-once

Started                                checked

Click next

select source Destination : sourceDestinationQueue

click next

select Messaging provider : Weblogic server 7.0 or higher

click next

select target Destination :targetDestinationQueue

click next

select Messaging provider : Other JMS

click next

myserver should be checked

click next

click finish

Now bridge is created and deployed to Weblogic

Add following jars into Weblogic CLASSPATH

slf4j-api-1.6.4.jar

activemq-core-5.5.0.jar

Once it is sure the above jars are in the Weblogic CLASSPATH

restart Weblogic.

1 comment:

  1. Weblogic And Soa Administrator: Create Jms Bridge Between Wls And Ibm Websphere Mq >>>>> Download Now

    >>>>> Download Full

    Weblogic And Soa Administrator: Create Jms Bridge Between Wls And Ibm Websphere Mq >>>>> Download LINK

    >>>>> Download Now

    Weblogic And Soa Administrator: Create Jms Bridge Between Wls And Ibm Websphere Mq >>>>> Download Full

    >>>>> Download LINK 6U

    ReplyDelete