Overview
Around the summer 2015, I prepared a demo for a customer to show how Oracle Middleware and IBM MQ can interface. When I started to prepare the demo, I googled for a quick example, but I didn’t find one. As a side note: I did find again the JMS article series by John Brown Evans: https://blogs.oracle.com/soaproactive/entry/how_to_create_a_simple. That is still an excellent series of blog posts that will get you started with JMS easily!
What made the topic difficult is that you need to combine various areas: IBM MQ installation/configuration, WebLogic configuration for the JCA adapters, and making the code – for both BPEL and Service Bus.
Anyway, I thought I would share my notes with you. So a couple of train rides later, here’s the result…
Oh, and it is now upgraded to SOA Suite 12.2.1.
I have split up the topics over a couple of articles:
- 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 case: MQ Transport
Goal
The goal of the article series is to get you easily started on combining Oracle Middleware with IBM MQ Series. As the JCA Adapters are also available for Service Bus, I combined both the Service Bus and BPEL into the use cases. I ended with a short article on the MQ Transport. The JMS over MQ transport is not covered.
The choice on what of the above options to use, depends on your customers use case. I recommend to spend some time on it. E.g. the simple statement that ‘the Service Bus MQ Transport does NOT support remote transactions’ should be taken into account. As well as several other properties. You should spend some time on carefully designing this!
Goal of these articles is to provide you with a simple configuration – to get you going:
- No transaction support
- Simple put/get of messages
- No MQ request/reply
- No encryption
I kept it simple so you will get to a working configuration. From that starting point, you can add/change features as you see fit.
Now it’s time to get going…
IBM MQ Installation
The IBM MQ Installation will consist of the following steps:
- Compatibility check
- Download MQ
- Prepare the Linux system
- Install IBM MQ
Compatibility check
Compatibility – Oracle FMW adapters and MQ
First topic to look into is that of IBM MQ compatibility: the solution has to be supported by Oracle.
The Oracle JCA Adapter for MQ Series (aka MQ Adapter) is certified for MQ Series 7.5:
http://docs.oracle.com/middleware/1221/adapters/develop-soa-adapters/GUID-4948ACC3-3413-4BF1-82B0-3DB00AA20CE3.htm#TKADP1564
Oracle is a bit less explicit about the Oracle JMS Adapter for MQ Series, but the Oracle documentation refers to MQ Series 7.5 here: https://docs.oracle.com/middleware/1213/adapters/develop-soa-adapters/GUID-2F26D2ED-BAE0-4009-9AE9-5A5889171C25.htm#TKADP1223
For both adapters, version IBM MQ 8.0 does not seem to be supported (yet?).
Compatibility – Operating System
There is an easy way to do a quick installation of IBM MQ by Roman Kharkovski:
http://whywebsphere.com/2014/01/23/install-websphere-mq-v7-5-on-red-hat-linux-in-under-1-minute-with-one-click/
I did this with Oracle Enterprise Linux 6.5 and SOA Suite 12.1.3 and found that the MQ installation is sufficient for development purposes.
The above article is based on the combination of RedHat Linux 6.5 Operating System with MQ Version 7.5.0.2.
Now, I will be using Oracle Enterprise Linux 7.2. Looking at the IBM support information, MQ must be patched to version is 7.5.0.5 (http://www-01.ibm.com/support/docview.wss?uid=swg27027462#Linux_Operating_Systems ).
For me, that was enough excuse to start a manual installation
Installation step 1: Download MQ
With IBM, download: WebSphere MQ Version 7.5.0.2 Trail Edition:
- Name: WebSphere MQ V7.5.0.2 Trial for Linux on x86 64bit Multilingual
- File name: MQ_7.5.0.2_TRIAL_LNX_ON_X86_64_ML.tar.gz (448 MB)
- Location: http://www.ibm.com/software/products/en/wmq/
Then, also download the patch MQ Version 7.5.0.5:
- Name: Fix Pack 7.5.0.5 for WebSphere MQ on Linux X86-64
- File name: 7.5.0-WS-MQ-LinuxX64-FP0005.tar.gz (380 MB)
- Location: http://www-933.ibm.com/support/fixcentral/
Use Product selector ‘WebSphere MQ’, Installed Version ‘7.5’ and Platform ‘Linux 64-bit x86_64’ to start searching for the fix.
Installation step 2: Prepare the Linux system
Starting point is a Linux system with a SOA Suite installation:
The system has:
- Linux version OEL 7.2
- SOA Suite 12.2.1, compact domain installation, Oracle XE 11g database
2.1 Add user and group mqm
Add user and group mqm, with mqm the primary group for user mqm. As user root:
[root@localhost ~]# groupadd mqm
[root@localhost ~]# adduser -d /home/mqm -g mqm -p welcome01 mqm
[root@localhost ~]# usermod –groups mqm developer
The last line makes it possible for user ‘developer’ to run MQ commands. Note that I have a user ‘developer’ 😉
2.2 Kernel configuration
IBM requires the following minimum configuration:
kernel.shmmni = 4096<br>kernel.shmall = 2097152<br>kernel.shmmax = 268435456<br>kernel.sem = 500 256000 250 1024<br>fs.file-max = 524288<br>kernel.pid-max = 120000<br>kernel.threads-max = 48000
This can be checked in the following way (as usder root):
[root@localhost ~]# cat /proc/sys/kernel/shmmni
4096
[root@localhost ~]# cat /proc/sys/kernel/shmall
2097152
[root@localhost ~]# cat /proc/sys/kernel/shmmax
4294967295
[root@localhost ~]# cat /proc/sys/kernel/sem
250 32000 100 128
[root@localhost ~]# cat /proc/sys/fs/file-max
6815744
[root@localhost ~]#
If required, update the file /etc/sysctl.conf. In our case, it was changed to:
###########<br># Oracle Database 11g Express Edition Recommended Values<br># The line below is the result of the XE install:<br># kernel.sem = 250 32000 100 128<br># It was changed for MQ to:<br>kernel.sem = 500 256000 250 1024<br>kernel.shmmax = 4294967295<br>fs.file-max = 6815744<br>########
Load and verify the changed setting:
[root@localhost ~]# sysctl –p<br>kernel.sem = 500 256000 250 1024<br>kernel.shmmax = 4294967295<br>fs.file-max = 6815744<br>[root@localhost ~]# cat /proc/sys/kernel/sem<br>500 256000 250 1024<br>[root@localhost ~]#
Moving on to the kernel settings:
[root@localhost ~]# cat /proc/sys/kernel/pid_max <br>32768<br>[root@localhost ~]# cat /proc/sys/kernel/threads-max <br>123184<br>[root@localhost ~]# echo 120000 > /proc/sys/kernel/pid_max <br>[root@localhost ~]# cat /proc/sys/kernel/pid_max <br>120000<br>[root@localhost ~]#
2.3 User settings
Edit file /etc/security/limits.d/mqm.conf as user root:
# Security limits for members of the mqm group<br>mqm soft nofile 1048576<br>mqm hard nofile 1048576<br>mqm soft nproc 1048576<br>mqm hard nproc 1048576
There are many more settings / changes that can be done for tuning an MQ system, but for development purposes, the above should be sufficient. For more information, please refer to https://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ins.doc/q008490_.htm.
Installation step 3: Install the MQ components
3.1 Unzip the archive
First, the downloaded archive has to be unzip-ed. It was downloaded to directory /home/developer/stage. Unzip as user root.
[root@localhost ~]# cd /home/developer/stage/<br>[root@localhost stage]# ls<br>MQ_7.5.0.2_TRIAL_LNX_ON_X86_64_ML.tar.gz<br>[root@localhost stage]# tar xvf MQ_7.5.0.2_TRIAL_LNX_ON_X86_64_ML.tar.gz<br>...<br>...<br>[root@localhost stage]# ls<br>copyright MQSeriesMsg_es-7.5.0-2.x86_64.rpm<br>crtmqpkg MQSeriesMsg_fr-7.5.0-2.x86_64.rpm<br>lap MQSeriesMsg_hu-7.5.0-2.x86_64.rpm<br>licenses MQSeriesMsg_it-7.5.0-2.x86_64.rpm<br>MQ_7.5.0.2_TRIAL_LNX_ON_X86_64_ML.tar.gz MQSeriesMsg_ja-7.5.0-2.x86_64.rpm<br>mqlicense.sh MQSeriesMsg_ko-7.5.0-2.x86_64.rpm<br>MQSeriesAMS-7.5.0-2.x86_64.rpm MQSeriesMsg_pl-7.5.0-2.x86_64.rpm<br>MQSeriesClient-7.5.0-2.x86_64.rpm MQSeriesMsg_pt-7.5.0-2.x86_64.rpm<br>MQSeriesExplorer-7.5.0-2.x86_64.rpm MQSeriesMsg_ru-7.5.0-2.x86_64.rpm<br>MQSeriesFTAgent-7.5.0-2.x86_64.rpm MQSeriesMsg_Zh_CN-7.5.0-2.x86_64.rpm<br>MQSeriesFTBase-7.5.0-2.x86_64.rpm MQSeriesMsg_Zh_TW-7.5.0-2.x86_64.rpm<br>MQSeriesFTLogger-7.5.0-2.x86_64.rpm MQSeriesRuntime-7.5.0-2.x86_64.rpm<br>MQSeriesFTService-7.5.0-2.x86_64.rpm MQSeriesSamples-7.5.0-2.x86_64.rpm<br>MQSeriesFTTools-7.5.0-2.x86_64.rpm MQSeriesSDK-7.5.0-2.x86_64.rpm<br>MQSeriesGSKit-7.5.0-2.x86_64.rpm MQSeriesServer-7.5.0-2.x86_64.rpm<br>MQSeriesJava-7.5.0-2.x86_64.rpm MQSeriesXRClients-7.5.0-2.x86_64.rpm<br>MQSeriesJRE-7.5.0-2.x86_64.rpm MQSeriesXRService-7.5.0-2.x86_64.rpm<br>MQSeriesMan-7.5.0-2.x86_64.rpm PreReqs<br>MQSeriesMsg_cs-7.5.0-2.x86_64.rpm READMEs<br>MQSeriesMsg_de-7.5.0-2.x86_64.rpm repackage<br>[root@localhost stage]#
3.2 Accept the license
As user root:
[root@localhost stage]# pwd<br>/home/developer/stage<br>[root@localhost stage]# ./mqlicense.sh –accept<br>Licensed Materials - Property of IBM <br> <br>5724-H72 <br>(C) Copyright IBM Corporation 1994, 2013 All rights reserved.<br>US Government Users Restricted Rights - Use, duplication or disclosure<br>restricted by GSA ADP Schedule Contract with IBM Corp.<br> <br>Agreement accepted: Proceed with install.<br>[root@localhost stage]#
3.3 Install MQ 7.5.0.2
Now, MQ can be installed. Use /opt/mqm as the installation directory. As user root:
[root@localhost stage]# pwd<br>/home/developer/stage<br>[root@localhost stage]# rpm --prefix /opt/mqm -ivh MQSeriesRuntime-*.rpm MQSeriesServer-*.rpm MQSeriesClient-*.rpm MQSeriesSDK-*.rpm MQSeriesMan-*.rpm MQSeriesSamples-*.rpm MQSeriesJRE-*.rpm MQSeriesExplorer-*.rpm MQSeriesJava-*.rpm<br>Preparing... ################################# [100%]<br>Updating / installing...<br> 1:MQSeriesRuntime-7.5.0-2 ################################# [ 11%]<br> 2:MQSeriesJRE-7.5.0-2 ################################# [ 22%]<br> 3:MQSeriesExplorer-7.5.0-2 ################################# [ 33%]<br> 4:MQSeriesServer-7.5.0-2 ################################# [ 44%]<br>After the installation has completed, run the '/opt/mqm/bin/mqconfig' command, using the 'mqm' user ID.<br>For example, execute the following statement when running as the 'root' user:<br> su mqm -c "/opt/mqm/bin/mqconfig"<br>The 'mqconfig' command validates that the system configuration satisfies the<br>requirements for WebSphere MQ, and ensures that the settings for the 'mqm'<br>user ID are suitably configured. Other WebSphere MQ administrators in the<br>'mqm' group can run this command to ensure their user limits are also<br>properly configured to use WebSphere MQ.<br>If 'mqconfig' indicates that any of the requirements have not been met,<br>consult the installation section within the WebSphere MQ Information Center<br>for details about how to configure the system and user limits.<br> 5:MQSeriesClient-7.5.0-2 ################################# [ 56%]<br> 6:MQSeriesSDK-7.5.0-2 ################################# [ 67%]<br> 7:MQSeriesMan-7.5.0-2 ################################# [ 78%]<br> 8:MQSeriesSamples-7.5.0-2 ################################# [ 89%]<br> 9:MQSeriesJava-7.5.0-2 ################################# [100%]<br>[root@localhost stage]#
3.4 Check the configuration
[root@localhost stage]# su mqm -c "/opt/mqm/bin/mqconfig"<br>mqconfig: Analyzing Red Hat Enterprise Linux Server release 7.2 (Maipo)<br> settings for WebSphere MQ V7.5<br>System V Semaphores<br> semmsl (sem:1) 500 semaphores IBM>=500 PASS<br> semmns (sem:2) 105 of 256000 semaphores (0%) IBM>=256000 PASS<br> semopm (sem:3) 250 operations IBM>=250 PASS<br> semmni (sem:4) 2 of 1024 sets (0%) IBM>=1024 PASS<br>System V Shared Memory<br> shmmax 4294967295 bytes IBM>=268435456 PASS<br> shmmni 8 of 4096 sets (0%) IBM>=4096 PASS<br> shmall 10980 of 2097152 pages (0%) IBM>=2097152 PASS<br>System Settings<br> file-max 13920 of 6815744 files (0%) IBM>=524288 PASS<br> tcp_keepalive_time 7200 seconds IBM<=300 FAIL<br>Current User Limits (mqm)<br> nofile (-Hn) 1048576 files IBM>=10240 PASS<br> nofile (-Sn) 1048576 files IBM>=10240 PASS<br> nproc (-Hu) 9 of 1048576 processes (0%) IBM>=4096 PASS<br> nproc (-Su) 9 of 1048576 processes (0%) IBM>=4096 PASS<br>[root@localhost stage]#
The tcp keep-alive setting is concerned with detecting dead pears and preventing disconnectioins due to network inactivity on tcp level. Since that is not very important for our demo environment, we leave it on the default value of 7200 secs.
3.5 Upgrading to MQ 7.5.0.5
Ensure that the upgrade file 7.5.0-WS-MQ-LinuxX64-FP0005.tar.gz is in the directory /home/developer/stage. Then unzip it:
[root@localhost ~]# cd /home//developer/stage/<br>[root@localhost stage]# pwd<br>/home/developer/stage<br>[root@localhost stage]# ls<br>7.5.0-WS-MQ-LinuxX64-FP0005.tar.gz<br>[root@localhost stage]# gunzip 7.5.0-WS-MQ-LinuxX64-FP0005.tar.gz <br>[root@localhost stage]# ls<br>7.5.0-WS-MQ-LinuxX64-FP0005.tar<br>[root@localhost stage]# tar xvf 7.5.0-WS-MQ-LinuxX64-FP0005.tar<br>...<br>...<br>./repackage/MQSeriesXRClients.spec<br>./repackage/MQSeriesXRService.spec<br>[root@localhost stage]# ls<br>7.5.0-WS-MQ-LinuxX64-FP0005.tar MQSeriesMsg_hu-U200533-7.5.0-5.x86_64.rpm<br>crtmqfp MQSeriesMsg_it-U200533-7.5.0-5.x86_64.rpm<br>MQSeriesAMS-U200533-7.5.0-5.x86_64.rpm MQSeriesMsg_ja-U200533-7.5.0-5.x86_64.rpm<br>MQSeriesClient-U200533-7.5.0-5.x86_64.rpm MQSeriesMsg_ko-U200533-7.5.0-5.x86_64.rpm<br>MQSeriesExplorer-U200533-7.5.0-5.x86_64.rpm MQSeriesMsg_pl-U200533-7.5.0-5.x86_64.rpm<br>MQSeriesFTAgent-U200533-7.5.0-5.x86_64.rpm MQSeriesMsg_pt-U200533-7.5.0-5.x86_64.rpm<br>MQSeriesFTBase-U200533-7.5.0-5.x86_64.rpm MQSeriesMsg_ru-U200533-7.5.0-5.x86_64.rpm<br>MQSeriesFTLogger-U200533-7.5.0-5.x86_64.rpm MQSeriesMsg_Zh_CN-U200533-7.5.0-5.x86_64.rpm<br>MQSeriesFTService-U200533-7.5.0-5.x86_64.rpm MQSeriesMsg_Zh_TW-U200533-7.5.0-5.x86_64.rpm<br>MQSeriesFTTools-U200533-7.5.0-5.x86_64.rpm MQSeriesRuntime-U200533-7.5.0-5.x86_64.rpm<br>MQSeriesGSKit-U200533-7.5.0-5.x86_64.rpm MQSeriesSamples-U200533-7.5.0-5.x86_64.rpm<br>MQSeriesJava-U200533-7.5.0-5.x86_64.rpm MQSeriesSDK-U200533-7.5.0-5.x86_64.rpm<br>MQSeriesJRE-U200533-7.5.0-5.x86_64.rpm MQSeriesServer-U200533-7.5.0-5.x86_64.rpm<br>MQSeriesMan-U200533-7.5.0-5.x86_64.rpm MQSeriesXRClients-U200533-7.5.0-5.x86_64.rpm<br>MQSeriesMsg_cs-U200533-7.5.0-5.x86_64.rpm MQSeriesXRService-U200533-7.5.0-5.x86_64.rpm<br>MQSeriesMsg_de-U200533-7.5.0-5.x86_64.rpm readme<br>MQSeriesMsg_es-U200533-7.5.0-5.x86_64.rpm repackage<br>MQSeriesMsg_fr-U200533-7.5.0-5.x86_64.rpm
Now, the new rpm’s can be installed:
[root@localhost stage]# rpm -ihv MQSeriesRuntime-*.rpm MQSeriesServer-*.rpm MQSeriesClient-*.rpm MQSeriesSDK-*.rpm MQSeriesMan-*.rpm MQSeriesSamples-*.rpm MQSeriesJRE-*.rpm MQSeriesExplorer-*.rpm MQSeriesJava-*.rpm<br>Preparing... ################################# [100%]<br>Updating / installing...<br> 1:MQSeriesRuntime-U200533-7.5.0-5 ################################# [ 11%]<br> 2:MQSeriesServer-U200533-7.5.0-5 ################################# [ 22%]<br>After the installation of this fix pack has completed, run the<br>'/opt/mqm/bin/mqconfig' command, using the 'mqm' user ID.<br>For example, execute the following statement when running as the 'root' user:<br> su mqm -c "/opt/mqm/bin/mqconfig"<br>The 'mqconfig' command validates that the system configuration satisfies the<br>requirements for WebSphere MQ, and ensures that the settings for the 'mqm'<br>user ID are suitably configured. Other WebSphere MQ administrators in the<br>'mqm' group can run this command to ensure their user limits are also<br>properly configured to use WebSphere MQ.<br>If 'mqconfig' indicates that any of the requirements have not been met,<br>consult the installation section within the WebSphere MQ Information Center<br>for details about how to configure the system and user limits.<br> 3:MQSeriesClient-U200533-7.5.0-5 ################################# [ 33%]<br> 4:MQSeriesSDK-U200533-7.5.0-5 ################################# [ 44%]<br> 5:MQSeriesMan-U200533-7.5.0-5 ################################# [ 56%]<br> 6:MQSeriesSamples-U200533-7.5.0-5 ################################# [ 67%]<br> 7:MQSeriesJRE-U200533-7.5.0-5 ################################# [ 78%]<br> 8:MQSeriesExplorer-U200533-7.5.0-5 ################################# [ 89%]<br> 9:MQSeriesJava-U200533-7.5.0-5 ################################# [100%]<br>[root@localhost stage]#
Check again the configuration:
[root@localhost stage]# su mqm -c "/opt/mqm/bin/mqconfig"<br>mqconfig: Analyzing Red Hat Enterprise Linux Server release 7.2 (Maipo)<br> settings for WebSphere MQ V7.5<br>System V Semaphores<br> semmsl (sem:1) 500 semaphores IBM>=500 PASS<br> semmns (sem:2) 105 of 256000 semaphores (0%) IBM>=256000 PASS<br> semopm (sem:3) 250 operations IBM>=250 PASS<br> semmni (sem:4) 2 of 1024 sets (0%) IBM>=1024 PASS<br>System V Shared Memory<br> shmmax 4294967295 bytes IBM>=268435456 PASS<br> shmmni 8 of 4096 sets (0%) IBM>=4096 PASS<br> shmall 10980 of 2097152 pages (0%) IBM>=2097152 PASS<br>System Settings<br> file-max 13888 of 6815744 files (0%) IBM>=524288 PASS<br> tcp_keepalive_time 7200 seconds IBM<=300 FAIL<br>Current User Limits (mqm)<br> nofile (-Hn) 1048576 files IBM>=10240 PASS<br> nofile (-Sn) 1048576 files IBM>=10240 PASS<br> nproc (-Hu) 9 of 1048576 processes (0%) IBM>=4096 PASS<br> nproc (-Su) 9 of 1048576 processes (0%) IBM>=4096 PASS<br>[root@localhost stage]#
Which all looks OK, except for the already known tcp keep-alive setting.
3.6 Set primary installation
This MQ installation needs to be set as the primary installation:
[root@localhost stage]# /opt/mqm/bin/setmqinst -i -p /opt/mqm</p> <p>18 of 118 tasks have been completed successfullysuccessfuly.<br>'Installation1' (/opt/mqm) set as the Primary Installation.<br>[root@localhost stage]#
and list the version:
[root@localhost stage]# /opt/mqm/bin/dspmqver<br>Name: WebSphere MQ<br>Version: 7.5.0.5<br>Level: p750-005-150424<br>BuildType: IKAP - (Production)<br>Platform: WebSphere MQ for Linux (x86-64 platform)<br>Mode: 64-bit<br>O/S: Linux 3.8.13-118.2.2.el7uek.x86_64<br>InstName: Installation1<br>InstDesc:<br>Primary: Yes<br>InstPath: /opt/mqm<br>DataPath: /var/mqm<br>MaxCmdLevel: 750<br>LicenseType: Trial<br>[root@localhost stage]#
3.7 Create QueueManager QM_AMIS
For the examples we will implement, we need a QueueManager, named QM_AMIS.
First, make the required directories (as user developer):
[developer@localhost ~]$ mkdir /var/mqm/QM_AMIS_DATA<br>[developer@localhost ~]$ chmod g+rwx /var/mqm/QM_AMIS_DATA<br>[developer@localhost ~]$ mkdir /var/mqm/QM_AMIS_LOG<br>[developer@localhost ~]$ chmod g+rwx /var/mqm/QM_AMIS_LOG
Now create the QueueManager.
The command for creating the QueueManager is:
crtmqm -q -u SYSTEM.DEAD.LETTER.QUEUE -lc -ld /var/mqm/QM_AMIS_LOG -lf 16384 -lp 16 -md /var/mqm/QM_AMIS_DATA QM_AMIS
The parameters have the following meaning:
-q Make this queue manager the default queue manager.<br>-u Dead-letter queue name.<br>-lc Use circular logging. <br>-ld Directory used to hold the log files for the queue manager.<br>-lf Log file size, specified in units of 4 KB pages. <br>-lp Primary log files allocated when the queue manager is created. <br>-md Directory used to hold the data files for the queue manager.
Command execution (as user developer):
[developer@localhost mqm]$ crtmqm -q -u SYSTEM.DEAD.LETTER.QUEUE -lc -ld /var/mqm/QM_AMIS_LOG -lf 16384 -lp 16 -md /var/mqm/QM_AMIS_DATA QM_AMIS<br>There are 87 days left in the trial period for this copy of WebSphere MQ.<br>WebSphere MQ queue manager created.<br>Directory '/var/mqm/QM_AMIS_DATA/QM_AMIS' created.<br>The queue manager is associated with installation 'Installation1'.<br>Creating or replacing default objects for queue manager 'QM_AMIS'.<br>Default objects statistics : 74 created. 0 replaced. 0 failed.<br>Completing setup.<br>Setup completed.<br>[developer@localhost mqm]$
And set the default setting for the QueueManager. This is done using the command:
strmqm -c QM_AMIS
where the -c option means:
-c Redefine the default and system objects, then stop the queue manager.
Output of the command:
[developer@localhost mqm]$ strmqm -c QM_AMIS<br>WebSphere MQ queue manager 'QM_AMIS' starting.<br>The queue manager is associated with installation 'Installation1'.<br>5 log records accessed on queue manager 'QM_AMIS' during the log replay phase.<br>Log replay for queue manager 'QM_AMIS' complete.<br>Transaction manager state recovered for queue manager 'QM_AMIS'.<br>Creating or replacing default objects for queue manager 'QM_AMIS'.<br>Default objects statistics : 1 created. 73 replaced. 0 failed.<br>Completing setup.<br>Setup completed.<br>[developer@localhost mqm]$
Look at status of the QueueManager:
[developer@localhost mqm]$ dspmq<br>QMNAME(QM_AMIS) STATUS(Ended immediately)<br>[developer@localhost mqm]$
3.8 Create Queues, Listener and Channel
Queues have to be created for the use cases that will be implemented:
- TEXT_MSG_REQUEST_Q
- TEXT_MSG_REPLY_Q
- JMS_MSG_REQUEST_Q
- JMS_MSG_REPLY_Q
First, start the QueueManager:
[developer@localhost mqm]$ strmqm<br>There are 87 days left in the trial period for this copy of WebSphere MQ.<br>WebSphere MQ queue manager 'QM_AMIS' starting.<br>The queue manager is associated with installation 'Installation1'.<br>5 log records accessed on queue manager 'QM_AMIS' during the log replay phase.<br>Log replay for queue manager 'QM_AMIS' complete.<br>Transaction manager state recovered for queue manager 'QM_AMIS'.<br>WebSphere MQ queue manager 'QM_AMIS' started using V7.5.0.5.<br>[developer@localhost mqm]$
Create the queues (still as user developer):
[developer@localhost mqm]$ runmqsc QM_AMIS<br>5724-H72 (C) Copyright IBM Corp. 1994, 2011. ALL RIGHTS RESERVED.<br>Starting MQSC for queue manager QM_AMIS.<br> <br>define qlocal(TEXT_MSG_REQUEST_Q) maxdepth(5000)<br> 1 : define qlocal(TEXT_MSG_REQUEST_Q) maxdepth(5000)<br>AMQ8006: WebSphere MQ queue created.<br>define qlocal(TEXT_MSG_REPLY_Q) maxdepth(5000)<br> 2 : define qlocal(TEXT_MSG_REPLY_Q) maxdepth(5000)<br>AMQ8006: WebSphere MQ queue created.<br>define qlocal(JMS_MSG_REQUEST_Q) maxdepth(5000)<br> 3 : define qlocal(JMS_MSG_REQUEST_Q) maxdepth(5000)<br>AMQ8006: WebSphere MQ queue created.<br>define qlocal(JMS_MSG_REPLY_Q) maxdepth(5000)<br> 4 : define qlocal(JMS_MSG_REPLY_Q) maxdepth(5000)<br>AMQ8006: WebSphere MQ queue created.<br>define listener(L1) trptype(tcp) port(1420) control(qmgr)<br> 5 : define listener(L1) trptype(tcp) port(1420) control(qmgr)<br>AMQ8626: WebSphere MQ listener created.<br>start listener(L1)<br> 6 : start listener(L1)<br>AMQ8021: Request to start WebSphere MQ listener accepted.<br>alter channel(SYSTEM.DEF.SVRCONN) chltype(SVRCONN) sharecnv(0)<br> 7 : alter channel(SYSTEM.DEF.SVRCONN) chltype(SVRCONN) sharecnv(0)<br>AMQ8016: WebSphere MQ channel changed.<br>define channel(system.admin.svrconn) chltype(svrconn) mcauser('mqm') replace<br> 8 : define channel(system.admin.svrconn) chltype(svrconn) mcauser('mqm') replace<br>AMQ8014: WebSphere MQ channel created.<br>define channel(S_AMIS) chltype(svrconn) replace<br> 9 : define channel(S_AMIS) chltype(svrconn) replace<br>AMQ8014: WebSphere MQ channel created.<br>set clauth(*) type(BLOCKUSER) userlist('*MQADMIN') action(REMOVE) <br> 10 : set chlauth(*) type(blockuser) userlist('*MQADMIN') action(remove)<br>AMQ8877: WebSphere MQ channel authentication record set.<br>end<br> 11 : end<br>10 MQSC commands read.<br>No commands have a syntax error.<br>All valid MQSC commands were processed.<br>[developer@localhost mqm]$
Some comments to help the Oracle wrestlers to better understand the IBM thingies:
(for reference: https://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ref.adm.doc/q085130_.htm)
[developer@localhost ~]$ runmqsc QM_AMIS
runmqsc is used to send commands to a queue manager
1 : define qlocal(TEXT_MSG_REQUEST_Q) maxdepth(5000)<br> 2 : define qlocal(TEXT_MSG_REPLY_Q) maxdepth(5000)<br> 3 : define qlocal(JMS_MSG_REQUEST_Q) maxdepth(5000)<br> 4 : define qlocal(JMS_MSG_REPLY_Q) maxdepth(5000)
First 4 commands create the required queues and set the max # msgs for the queue
5 : define listener(L1) trptype(tcp) port(1420) control(qmgr)
Create listener L1, that:
- uses tcp for transmission protocol on port 1420
- and indicate that the listener is to be started/stopped together with the Queue Manager
6 : start listener(L1)
Start channel listener
7 : alter channel(SYSTEM.DEF.SVRCONN) chltype(SVRCONN) sharecnv(0)
changes the server channel ‘system.def.svrconn’ (this channel was automatically created with the QueueManager)
of channel type ‘svrconn’: server connection
Specifies no sharing of conversations over a TCP/IP channel instance.
(this is set to 0 for the MQ Adapter, as per Oracle documentation:
‘In addition, if you are using the Oracle MQ Series 7 Adapter , the new “SharingConversation” property of the MQ Series 7 Server Connection Channel has to be to set to zero’
8 : define channel(system.admin.svrconn) chltype(svrconn) mcauser('mqm') replace
Create the channel system.admin.svrconn, which is needed for the MQ Explorer, user mqm
9 : define channel(S_AMIS) chltype(svrconn) replace
Create a channel S_AMIS that the JMS adapter can use
10 : set chlauth(*) type(blockuser) userlist('*MQADMIN') action(remove)
Remove the default authentication record
11 : end
Done!
3.9 Re-start QueueManager QM_AMIS
A re-start is now required:
[developer@localhost mqm]$ endmqm QM_AMIS<br>Quiesce request accepted. The queue manager will stop when all outstanding work<br>is complete.<br>[developer@localhost mqm]$ strmqm QM_AMIS<br>There are 87 days left in the trial period for this copy of WebSphere MQ.<br>WebSphere MQ queue manager 'QM_AMIS' starting.<br>The queue manager is associated with installation 'Installation1'.<br>5 log records accessed on queue manager 'QM_AMIS' during the log replay phase.<br>Log replay for queue manager 'QM_AMIS' complete.<br>Transaction manager state recovered for queue manager 'QM_AMIS'.<br>WebSphere MQ queue manager 'QM_AMIS' started using V7.5.0.5.<br>[developer@localhost mqm]$
3.10 Start MQ Explorer
Now it’s time to start MQ Explorer:
[developer@localhost ~]$ /opt/mqm/bin/strmqcfg &
Which shows the MQ Explorer start-up window.
Now, you can browse through QM_AMIS to verify the above described changes:
Hi! This tutorial works with SOA 11g?
Hi Diego,
The MQ installation will be the same.
I expect the BPEL parts of this tutorial will work.
However, for OSB, the development environment is different (eclipse) and the JCA adapters for MQ and JMS are not supported in 11g – as far as I know. Please refer to http://www.oracle.com/technetwork/middleware/service-bus/documentation/index.html#11gr1.
So, for OSB 11g you will have to work with the MQ transport.
HTH,
Luc