Sunday, January 7, 2018

IBM WebSphere MQ bridge for HTTP on Tomcat 9.0.2

Requirements:

    1. IBM MQ server 
    2. WMQHTTP.war, location MQ_HOME\java\lib\http\
    3. IBM MQ client libraries 
    4. tomcat 


Tomcat and IBM MQ configuration:


Tomcat:
1. Copy WMQHTTP.war to apache-tomcat-9.0.2\webapps folder
2. Copy IBM MQ libraries from C:\Program Files\IBM\MQ\java\lib\*.jar to tomcat lib directory apache-tomcat-9.0.2\lib
3. Add to the context.xml file between Context tag resource below:
<Resource
name="jms/WMQHTTPJCAConnectionFactory"
auth="Container"
type="com.ibm.mq.jms.MQQueueConnectionFactory"
factory="com.ibm.mq.jms.MQQueueConnectionFactoryFactory"
HOST="127.0.0.1"
PORT="1415"
CHAN="HTTPTESTCHL"
TRAN="1"
QMGR="TEST3"/>
IBM MQ 9:
1. create channel HTTPTESTCHL:
    define chl(HTTPTESTCHL) type(SVRCONN) 
2. Create new channel authentication record:
SET CHLAUTH('HTTPTESTCHL') TYPE(USERMAP) CLNTUSER('test') USERSRC(MAP) MCAUSER('test') ADDRESS('*') ACTION(ADD)  
3. Grant user or group permission to access qmgr and local queue HTTPTESTQ:
 Queue:
setmqaut -m TEST3 -n "HTTPTESTQ" -t q -g "test" -remove
setmqaut -m TEST3 -n "HTTPTESTQ" -t q -g "test" +get +inq +put
 QMGR:
setmqaut -m TEST3 -t qmgr -g "test" -all
setmqaut -m TEST3 -t qmgr -g "test" +connect +inq
refresh security(*) 


Start Tomcat using startup.bat and after if possible to open message:
http://127.0.0.1:8080/WMQHTTP/msg/queue/HTTPTESTQ 

FYI:
From IBM MQ Version 8.0, the IBM MQ bridge for HTTP is deprecated. The IBM messaging REST API provided from IBM MQ Version 9.0.4 should be used as an alternative.

1 comment:

  1. HI,

    How you control the number of jms connexion pool ?

    ReplyDelete