MQ

MQ

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  MQ throwing MQRC_HEADER_ERROR

    Posted Mon December 26, 2022 01:36 PM
    I'm working one mq based application where i need to set JMS_IBM_Format as MQHMDE header, whenever i try to use this header i'm getting ('MQCC_FAILED') reason '2142' ('MQRC_HEADER_ERROR') error. Could you please help me how to place a message when using MQHMDE header, these are the info i'm using while sending
    JMSDeliveryMode -> Persistent
    JMS_IBM_Format -> MQConstants.MQFMT_MD_EXTENSION
    JMS_IBM_Character_Set -> 785
    JMS_IBM_Encoding -> 500
    CamelJmsDestinationName -> queue:///queueName?targetClient=0 (tried with target as 1 as well)
    I'm trying to send the msg through java based apache camel framework and the msg type is in string. Can someone please help me on this issue,
    detailed error message below
    java.lang.RuntimeException: org.springframework.jms.IllegalStateException: JMSWMQ2007: Failed to send a message to destination 'queueName'.; nested exception is com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ2007: Failed to send a message to destination 'queueName'. JMS attempted to perform an MQPUT or MQPUT1; however IBM MQ reported an error. Use the linked exception to determine the cause of this error.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2142' ('MQRC_HEADER_ERROR').

    ------------------------------
    Mallikarjun Kanavalli
    ------------------------------


  • 2.  RE: MQ throwing MQRC_HEADER_ERROR

    Posted Tue December 27, 2022 01:17 PM
    Edited by Francois Brandelik Tue December 27, 2022 01:18 PM
    You're going about it all the wrong way. I believe the usage of the extended header depends on the release of MQ you are using and the version of Header you are declaring.

    I would just go on and use a standard JMS message. See how that is handled by the receiver, and maybe you might just have your extended header because you have information for it.

    If you really need to use that header specifically, you will need to create a message with chained headers and use the header classes to write the header. This way you will also get the right alignments.

    Looks to me that you might also be mixing character set and encoding. Shouldn't the CCSID be 500 and the Encoding 785?.
    If you don't want an RFH header make sure to set targetClient=1. I would define the destination as queue:///QNAME?targetClient=1&CCSID=500

    Hope it helps some.

    ------------------------------
    Francois Brandelik
    ------------------------------