Oracle Middleware and IBM MQ Series – Use case: MQ Transport

Luc Gorissen 2

Series

This is the fifth post in a series on using Oracle Middleware with IBM MQ Series. In this series, the following articles are available:

  1. IBM MQ Series Installation and Configuration
  2. Configuration of JMS and MQ Adapters in WebLogic
  3. Use case: JMS Adapter and MQ
  4. Use case: MQ Adapter
  5. Use case: MQ Transport

MQ transport

This blog covers the exchange of text messages over MQ, using the MQ transport of Service Bus.

 

1. Overview

This blog covers the MQ Transport use case. It is structured in the following way:

  1. Overview
  2. Use case description
  3. Prepare the file system
  4. Service Bus produces msg with MQ Transport
  5. Service Bus consumes msg with MQ Transport
  6. Testing the use case

The projects can also be downloaded here.

 

2. Use case description

 

This use case shows how the Service Bus can be used to put/consume messages on an MQ queue, using MQ transport.

Note that when the Oracle JCA Adapters work with ‘Native format translation is not required (Schema is Opaque)’, they deliver their message in base64 encoded format. This is nicely explained by Lucas in https://technology.amis.nl/2014/08/06/opaque-does-not-mean-just-pass-anything-in-it-has-to-be-base64-jca-adapters/.

Therefore, when a JCA adapter puts a message on a MQ queue, and then a MQ transport picks up that message, a base64 decoding has to be done before the message content can be processed.

The use case covers the following situation:

1. SB puts a msg on an MQ queue, SB consumes a msg from the MQ queue

  • a file is put in directory …/usecase/mqtransport/osb/in
  • the SB service picks up the file with the file adapter
  • the SB service puts the file on queue TEXT_MSG_REQUEST_Q with the MQ transport
  • the SB Service picks up the msg from queue TEXT_MSG_REQUEST_Q with the MQ transport
  • the SB Service puts the message in directory …/usecase/mqtransport/osb/out

 

mqtr_request

 

In order to complete this use case, the File Adapter is used. The File Adapter is used in 2 different situations, but not described as that is not the focus of this article.
If you want to know more about the complete projects that are used, you can download the projects here.

 

3. Prepare the file system

 

The following directories have to be made:

[developer@localhost ~]$ cd usecase/<br>[developer@localhost usecase]$ pwd<br>/home/developer/usecase<br>[developer@localhost usecase]$ ls<br>jmsadapter&nbsp; mqadapter<br>[developer@localhost usecase]$ mkdir mqtransport<br>[developer@localhost usecase]$ mkdir mqtransport/osb<br>[developer@localhost usecase]$ mkdir mqtransport/osb/in<br>[developer@localhost usecase]$ mkdir mqtransport/osb/out<br>[developer@localhost usecase]$ 

 

4. Service Bus produces msg with MQ Transport

 

Starting point is a service bus project with a File Adapter that picks up a message from the directory /home/developer/usecase/mqtransport/osb/in.

 

mq_500_FileToMqTr_composite

 

The File Adapter configuration is not described.

 

When using the MQ Transport, first an MQ Connection must be added:

 

mq_501_FileToMqTr_createMqConnection

Create an MQ Conection, named MqAmis:

mq_502_FileToMqTr_createMqConnection-nameAmis

Configured like below:

 

mq_503_FileToMqTr_createMqConnection-configurationPage

Now, insert an MQ Transport:

mq_505_FileToMqTr_insert-mq-transport

 

with in the wizard the following entries:
1. Create Service with Service Name : MqTrOut and Transport type: mq

 

mq_506_FileToMqTr_insert-mq-transport-01

 

2. Set Service Type to ‘anyXML’

 

mq_507_FileToMqTr_insert-mq-transport-02

 

3. Set the endpoint URI to mq://TEXT_MSG_REQUEST_Q?conn=FileToMqTr_SB/MqAmis

 

mq_508_FileToMqTr_insert-mq-transport-03

 

That bring us to the situation:

mq_509_FileToMqTr_after_insert-mq-transport

 

After connecting Pipeline and Business Service:

 

mq_510_FileToMqTr_after_insert-mq-transport-connected

 

Now, the project can be deployed.

 

5. Service Bus consumes msg with MQ Transport

 

Starting point is a service bus project with a File Adapter that writes a message to the directory /home/developer/usecase/mqtransport/osb/out.

No pipeline – yet.

 

mq_600_MqToFile_composite

The File Adapter configuration is not described.

Now, configure an MQ Connection MqAmis just like in the previous project (above).

Next, insert an MQ Transport, with in the wizard the following entries:

  1. Create Service with Service Name : MqTrIn and Transport type: mq, and ‘Generate Pipeline’ checked and with pipeline name: MqTrToFile
  2. Set Service Type to ‘anyXML’
  3. Set the endpoint URI to mq://TEXT_MSG_REQUEST_Q?conn=MqTrToFile_SB/MqAmis

That bring us to the situation:

 

mq_601_MqToFile_composite-mq_transport-added

 

Connecting Pipeline and Business Service:

 

mq_602_MqToFile_composite-mq_transport-connected

Now, the project can be deployed.

 

6. Testing the use case

The projects can also be downloaded here.

The projects can be tested by copying some test messages into the directories:

  • ~/usecase/mqtransport/osb/in

… and then wait for them to appear in resp:

  • ~/usecase/mqtransport/osb/out

Mind the default 1 min polling the of the File Adapter.

2 thoughts on “Oracle Middleware and IBM MQ Series – Use case: MQ Transport

Comments are closed.

Next Post

Oracle Middleware and IBM MQ Series - Use case: JMS Adapter and MQ

Facebook0TwitterLinkedinSeries This is the third post in a series on using Oracle Middleware with IBM MQ Series. In this series, the following articles are available: IBM MQ Series Installation and Configuration Configuration of JMS and MQ Adapters in WebLogic Use case: JMS Adapter and MQ Use case: MQ Adapter Use […]