Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

IBM MQ PUT Message Format: MQSTR issue

IBM MQ PUT Message Format: MQSTR issue

IBM MQ PUT Message Format: MQSTR issue

Hi Folks,

I am trying to put message to MQ using Java, however, the message is going as MQHRF2 instead of MQSTR. I have been trying to resolve this from last 2 weeks but I am unable to. Need your help to kindly advise how I can get the MQSTR format. I am setting the message format as MQSTR, however it is getting overwritten. Below is the sample code I am using:

Hashtable<String, Object> props = new Hashtable<String, Object>();
        props.put("channel", "CLIENTS.ICARGO");
        props.put("port", 1414);
        props.put("hostname", "ei-s-mq.qantas.com.au");

        String qManager = "QMS126";
        String queueName = "IC.EI.XMAMS.AMADEUS.INOUT";
        MQQueueManager qMgr = null;

        try {

            qMgr = new MQQueueManager(qManager, props);
            int openOptions = MQConstants.MQOO_OUTPUT | CMQC.MQOO_SET_ALL_CONTEXT ;

            MQQueue queue = qMgr.accessQueue(queueName, openOptions);

            MQPutMessageOptions pmo = new MQPutMessageOptions();
            pmo.options = CMQC.MQPMO_SET_ALL_CONTEXT;

            MQMessage message = new MQMessage();
            message.setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED, true);
            message.setIntProperty(WMQConstants.WMQ_MQMD_MESSAGE_CONTEXT, WMQConstants.WMQ_MDCTX_SET_IDENTITY_CONTEXT);
            message.format = MQConstants.MQFMT_STRING;
            message.putApplicationName = "Tracking";
            message.applicationOriginData = "DATA";
            message.applicationIdData = "1ATYPBEIP";
            message.userId = "eiptypb";
            message.replyToQueueName = "IC.AMADEUS.ICARGOAMS.EI.INOUT.ERROR";
            message.replyToQueueManagerName = "QMS126";
            message.messageType = 8;
            message.persistence = 1;

            message.writeString("0D 0A 01 QD MELHOJQ 0D 0A . .SYDFRQF 054238 0D 0A 02 QF0001/30.SYD.FINAL -AKE1111111/MEL/1A/C BULK -MEL/1A/C SI LOADING PRIORITY AS FOLLOWS 1 - AKE1111111 1 - BULKMEL/1A/C 0D 0A 03");
            queue.put(message, pmo);

Thanks for your time and help.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close