How to read EBCDIC messages from the IBM Websphere JMS queue

Solution Verified - Updated -

Environment

  • JBoss Fuse 6.1

Issue

We have JBoss Fuse linking to an IBM websphere application server, which exposes a queue to us. We cannot consume off this queue because the data comes back encoded. Apparently they put EBCDIC data onto their queue and I need to understand how I can get this into ASCII.

Resolution

In order to read EBCDIC data from the WebSphere queue you need to convert the binary data you read from the queue into the CP037 encoded String. The snippet below demonstrates how to do it in Camel.

<from uri="jms:websphere-queue"/>
<marshal><string charset="CP037"/></marshal>
<to uri=..."/>

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments