Tuesday, July 13, 2010

Enqueue/Dequeue scenario in MQ with OSB

By default there is no MQ Connection in OSB so in order to work with OSB and MQ you have to copy the com.ibm.mq.jar file to the BEA_HOME\user_projects\domains\\lib directory.

com.ibm.mq.jar can be found from websphere mq installation.

ONce the file is copied in to the location.

Start your OSB Server and log in to OSB console using the following url

http://host:port/sbconsole.

NOw once done create a new session



Once you have created a new session go to
project Explorer and enter your project name.

and say add sample as you can see in my case i have created a folder MqSample.



now go inside the folder that you have created and create a mq connection as shown below



Now provide the connection details

The default channel i am using is SYSTEM.DEF.SVRCONN and the channel 1414

OracleMQ is the name of my queueManager provide these information and save the changes




Now once activate it to take effect.




Now log in to your MQ and create two queue over there i have created two queue there

ARPIT_IN for input and ARPIT_OUT for output queue.Both are local queue only.



Now create a new proxy service in the MqSample Folder as shown below and give it some logical name.



It will be a messaging service as shown





Make request and response as text type



Now this step is important choose the protocol as MQ

Now in the URL

Format: mq://local-queue-name?conn=mq-connection-resource-ref


Local-queue-name will be ARPIT_IN

conn=MqSample/MqConnection

as MqSample is the folder name and MqConnection is the name of connection that i have created for connecting to MQ.



Now in the next page i will provide the message response url as

mq://ARPIT_OUT?conn=MqSample/MqConnection

the only change that i have done is ARPIT_OUT instead of ARPIT_IN queue.

ONce make these change just keep on saying next till you reach the following page.Verify the connection.Save it and then then activate the changes.




Now you have created a simple project to verify the MQ inbound outbound scenarion.
In this sample The process is polling in ARPIT_IN queue and as soon as data will be inserted into ARPIT_IN queue the Proxy service will take it and copy in ARPIT_OUT queue.

Now to verify this we will insert a message in ARPIT_IN queue





As you cann see the current queue depth in in and out queue is zero i will put a message in arpit_in queue and will check if it gets published to arpit_out queue.


Just put some message in arpit_in queue as below


but it will remain in input queue for a moment and will be copied to output queue immediately as shown.Now browse the message to verify the same message.



This is a sample test for mq scenario you can use this concept to create you own complex customized service.Please post me any issues

7 comments:

Unknown said...

Hi Mikku,

This is Vijay, Thanks a lot on providing this material, I have followed the same and getting some exception on OSB console when i place the message on WS MQ.

Here is exception message:

<ExecuteReques
t failed
java.lang.NullPointerException.
java.lang.NullPointerException
at com.bea.wli.monitoring.statistics.collection.StatUpdater.refreshDeleg
ate(StatUpdater.java:57)
at com.bea.wli.monitoring.statistics.collection.StatUpdater$Counter.incr
ement(StatUpdater.java:87)
at com.bea.wli.sb.transports.TransportManagerImpl.receiveMessage(Transpo
rtManagerImpl.java:385)
at com.bea.wli.sb.transports.mq.InboundRequestWorkerThread.run(InboundRe
questWorkerThread.java:138)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTunin
gWorkManagerImpl.java:528)
Truncated. see log file for complete stacktrace



I am using OSB 11g & WS MQ 7.0

Any idea on this?

Mikku said...

Only MQ 6.0.1 and 6.0.2. With OSB 11gR1 PS2, 10.3.1, and 10gR3, you will need 6.0 client libraries to work with MQ 6.0.1 and 6.0.2

further you can check in certification matrix

http://www.oracle.com/technetwork/middleware/ias/downloads/fusion-certification-100350.html

and OSB documentation about the same

http://www.oracle.com/technetwork/middleware/service-bus/documentation/index.html

Mikku said...

The Oracle MQ Series Adapter is certified on IBM WebSphere MQ V7.0

Please check this issue with MQ version 6.x and verify if it is working fine ,Update me if you don't get it working with MQ 6.X

Unknown said...

Seems its the WLI issue, as NULL pointer exception is throwing from the WLI "com.bea.wli.monitoring.statistics.collection.StatUpdater.refreshDelege). Issue got resolved when i degrade to OSB 10g and WSMQ 6.

Thanks for your reply.

akabalde said...

I don't understand the job of the proxy in this development...

This copy the message from QUEUE-IN to QUEUE-OUT without be invoked?

Sorry for my bad English. :p

Anonymous said...

Truly when someone doesn't be aware of then its up to other users that they will help, so here
it happens.

sindhuja cynixit said...

I would like to thank you for the efforts you have made in writing this article, Its good and Informative.
Biztalk online training Hyderabad