I recently inherited a testing framework using PYMQI to put a message on IBM Websphere Queue. I fixed most of the code i need by going through this link
The only pending issue is the format of correlation ID. I tried quite a few options but MQ is converting the correlation ID Into byte array (seems IBM MQ default setting) before throwing it on the Q. All my downstream systems are looking for a HEX value and is breaking.
I am stuck on this for a few days now. Is there a way to force the correlation ID in message properties?.
Please let me know
Regards Aravind
@JoshMc thanks a lot for the reply. It is proprietary code so little difficult to paste whole thing however here is the relevant piece. Downstream system is looking at this JMS Correlation ID to increment and put back in the queue. When i am sending this through below code it hits queue gets converted to byte array however downstream system read validation fails. I want this to hit the queue as a HEX value as in it should be the exact value i pass and not byte array.
queue = self._open_write_queue(queue_name)
put_mqmd = pymqi.md()
put_mqmd.Format = CMQC.MQFMT_STRING
CCSID = 1202
put_opts = pymqi.pmo()
# Set the MsgType to request.
# put_mqmd["MsgType"] = CMQC.MQMT_REQUEST
put_mqmd["MsgId"] = '00002Y0001T1'
put_mqmd["CorrelId"] = '00002Y0001T1'
put_opts = pymqi.PMO(Options=CMQC.MQPMO_NO_SYNCPOINT +
CMQC.MQPMO_FAIL_IF_QUIESCING + CMQC.MQRO_PASS_CORREL_ID)
queue.put(message, put_mqmd, put_opts)
when I put a message through to the queue, it is getting posted successfully, but does not get processed by the downstream system:
In the screenshot above the first message in the queue was posted using app JMSToolBox- which has the correlationId as expected by the downstream systems. The second message was posted using robot framework/pymqi - which has the correlation-id displayed ID:30303..... Also please note that the JMSDestination is displayed as null for the second message.(For the first message posted manually has the as 'JMSDestination: queue:///QueueName'
Now i have two issues - CorrelationId not coming up as i expect and the JMSDestination:null. I'm not sure how I can set the destination using pymqi library(or is this set at Q-Manager level) Any help is much appreciated.
Screenshot of message sent by JMSToolBox:
Screenshot of message sent using robotframework-pymqi:
The only difference I find in the two messages now is the JMSDestination:Null in the JMSHeader for the message sent using Pymqi. I also tried changing the PROPCTL setting for the queue- but did not help.
Is there a I can send the java properties using pymqi?