Wednesday, December 17, 2014

Getting to know WebSphere MQ

Now that I have MQ queues set up to collect the traffic from my MQTT clients, and I have a simple IIB application that stores that data to a file system, my next step is to connect WebSphere Application Server 8.5.5 to MQ so it can subscribe to topics and queues.

But when I go to the WAS admin console and try to create an JMS Activation Spec, I find that WAS cannot connect to MQ.   Why is that?

Admin Console says:  A connection could not be made to WebSphere MQ for the following reason: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').

So first we need to look in the MQ logs.  There are three of them.  They are located here:

C:\Program Files (x86)\IBM\WebSphere MQ\Qmgrs\IB9QMGR\errors
C:\Program Files (x86)\IBM\WebSphere MQ\Qmgrs\@SYSTEM\errors
C:\Program Files (x86)\IBM\WebSphere MQ\errors

The first one has pay dirt.

12/17/2014 18:59:26 - Process(8804.3) User(MUSR_MQADMIN) Program(amqrmppa.exe)
                      Host(ADMINIB-GC3H285) Installation(Installation1)
                      VRMF(7.5.0.1) QMgr(IB9QMGR)
                   
AMQ9777: Channel was blocked

EXPLANATION:
The inbound channel 'SYSTEM.DEF.SVRCONN' was blocked from address '127.0.0.1'
because the active values of the channel matched a record configured with
USERSRC(NOACCESS). The active values of the channel were 'CLNTUSER(DeveloperHat)'.
ACTION:
Contact the systems administrator, who should examine the channel
authentication records to ensure that the correct settings have been
configured. The ALTER QMGR CHLAUTH switch is used to control whether channel
authentication records are used. The command DISPLAY CHLAUTH can be used to
query the channel authentication records.

--
So, as I recall, there was some security feature that was turned on by default in MQ 7.1 and I haven't played with MQ in this way since 7.0 I think, maybe earlier.

First we have to remember how to run MQ commands.  Do that by going to the MQ bin folder and running runmqsc QMGR, where QMGR is my queue manager name.  That opens a command window.

And then, for now, turn off channel security, which of course is not recommended for anything but your own personal test server, by issuing the command:  ALTER QMGR CHLAUTH(DISABLED)

--
And now WAS 8.5.5 can define Activation Specs and Factories to its heart's content.










No comments:

Post a Comment