By ShawnBailey on Dec 27, 2013
- Download MQ 7.5 from the IBM site (90 day trial license, Windows)
- Ran setup which was straightforward. Several questions concerning the domain controller but I said that I don't have any running Win 2000
- Started MQ Explorer and created a Queue Manager. Specified Transmission and DeadLetter queues along with exposing an external channel
- Created my queueus: Transmission, DeadLetter, LocalQueue1, LocalQueue2
- Created a 'Server-connection' channel. Note that the Channel may have a status of 'Inactive' and a red arrow pointing down. I spent a ton of time trying to get the arrow to be green and pointing up with a status of 'Active' but in the end it didn't seem to matter.
- Created a new user on the Windows machine that I wanted to connect to MQ as remotely
- Added the user to the Channel 'Specific Profiles' Authority Records and gave them all of the authorizations. Right click on the Channel -> Object Authorities -> Manage Authority Records -> Specific Profiles. There should be a default Specific Profile you can edit.
- Note: If you want to disable the security for the Channel you can go into the Authority Records and delete the default profile
- Using the command 'setmqaut -m <Queue Manager Name> -t qmgr -p <user@pcname> +all' I granted full MQ privs to the new user (command is in <MQ_HOME>/bin)
- Add the MQ jar files to <DOMAIN_HOME>/lib: com.ibm.mq.commonservices.jar, com.ibm.mq.headers.jar, com.ibm.mq.jar, com.ibm.mq.jmqi.jar, com.ibm.mq.pcf.jar (all can be obtained from the MQ Installation)
- Created a new composite application with input and output MQ Adapter instances
- The adapters both used the default 'eis/MQ/MQAdapter' JNDI from the default connection pool but be careful b/c the default JNDI in the Adapter wizard is 'eis/MQ/MQSeriesAdapter'. If you don't change it or create a new connection pool then the adapter will fail.
- Other values in the adapter wizard were defaults or obvious (queue name and my schema)
- In the WLS Console I went into the MQ Adapter deployment -> Configuration -> Connection Pool -> Default Pool to change set some properties
- Set channelName, hostName, password, queueManagerName, userID. Everything else I left as default.
- Deployed and ran the composite, verifying that the message ended up in the right MQ queue
I ran into some errors along the way:
MQJE001: Completion Code '2', Reason '2035': Due to insufficient permissions for the user I was trying to connect as. To resolve this I had to add the permissions using the 'setmqaut' command mentioned above. To make it simple I just granted full admin.
java.util.MissingResourceException: We document that you can get this if you don't have the correct MQ jar files in <DOMAIN_HOME>/lib. In my case it was due to a missing or wrong Channel Name configured in the connection pool properties.
Admittedly much of this is documented across various resources but I couldn't find anything that provided it all together. Now when I need to do this again in a year and have forgotten everything I'll have this blog post to come back to.
If everything works then you'll see the messages appear in the queue through MQ Explorer where you can then insepct the payload, etc.