At the end of June IBM released the IBM WebSphere MQ Bridge for HTTP support pack. What it basically does is to bring an HTTP API, in a RESTful way, to WebSphere MQ.
MA0Y requires:
- An application server supporting J2EE Connector Architecture, version 1.5.
- WebSphere MQ J2EE Connector Architecture (JCA) resource adapter deployed and operational (included in IBM WebSphere MQ version 6.0.2.1)
An WebSphere MQ resource adapter support statement can be found here.
The MA0Y support pack includes two downloads:
- Install
- includes the WMQHTTP web application archive
- Samples
- A pre-packaged IBM WebSphere Application Server Community Edition with WMQHTTP web application and WebSphere MQ J2EEConnectorArchitecture (JCA) resource adapter
- A client samle application called P2PConsole.
- Deployment plans for IBM Webphere Application Server Community Edition (applicable to Geronimo as well)
Get going with the samles download
- Download and extract from the support pack site
- Verify that you have a local queue manager set up named HTTP.QM
- Navigate to the ma0y.samples\WASCE\bin directory and execute startup.bat
- Navigate to the ma0y.samples\P2PConsole directory
- Run this command java -cp . HTTPPOST SYSTEM.DEFAULT.LOCAL.QUEUE localhost:8080 mq to put a message onto the SYSTEM.DEFAULT.LOCAL.QUEUE on queue manager HTTP.QM.
- Run this command to get (an WMQ get, not HTTP get) messages of the queue java -cp . HTTPDELETE SYSTEM.DEFAULT.LOCAL.QUEUE localhost:8080 mq.
Get going with a clean Geronimo and curl
- Verify that the queue manager HTTP.QM is started on your system.
- Download Geronimo 1.1.1 from here, extract the archive.
- Start Geronimo
- Open a command window in GERONIMO_HOME\bin
- Issue this command: SET JAVA_HOME=PATH_TO_IBM_JAVA. Substitute PATH_TO_IBM_JAVA with a path to an existing IBM Java 1.5 runtime (one is included in the samples package explained above). Using a Sun Java runtime will fail, see the Using JCA article at the IBM site.
- Execute startup.bat
- Geronimo is now started.
- Deploy the WebSphere MQ J2EEConnectorArchitecture (JCA) resource adapter
- Open the Geronimo Console by pointing your favourite browser to http://localhost:8080/console, log in using system/manager.
- Open Console Navigation > Applications > Deploy New
- Archive: WMQ_HOME\Java\lib\jca\wmq.jmsra.rar
- Plan: ma0y.samples\deployedFiles\WASCEPlans\geronimo-ra.xml
- Click Install
- Deploy the WMQHTTP web application archive
- Open the Geronimo Console by pointing your favourite browser to http://localhost:8080/console, log in using system/manager.
- Open Console Navigation > Applications > Deploy New
- Archive: ma0y.samples\deployedFiles\WMQHTTP.war
- Plan: ma0y.samples\deployedFiles\WASCEPlans\geronimo-web.xml (if you use the geronimo jetty bundle replace tomcat with jetty within the file)
- Click Install
- Start testing
- Download curl from the curl site, I used this version: curl-7.16.4-win32-ssl-sspi.zip. Extract and navigate to the directory.
- To PUT a message on a queue
- curl –data “Hello World” –header “Content-Type: text/plain” –verbose http://localhost:8080/mq/msg/queue/SYSTEM.DEFAULT.LOCAL.QUEUE
- To BROWSE the first message in the queue
- curl –get –verbose http://localhost:8080/mq/msg/queue/SYSTEM.DEFAULT.LOCAL.QUEUE
- To GET a message off a queue
- curl –request DELETE –verbose http://localhost:8080/mq/msg/queue/SYSTEM.DEFAULT.LOCAL.QUEUE
Colclusion
- Works like a charm (except for the IBM Java runtime dependency)
- Not yet supported (Category 2 support pack), but most likely will be in the near future.
- Heavy-weigh, needs an application server and resource adapter.
Filed under: ibm, MA0Y, mq, support pack, wmq