3
votes

Two separate processes are communicating via JMS over MQ.

The writer sets a string property:

new MessageAction() {
    public void actOn(Message message) throws JMSException {
        logger.debug("Setting message property (GmmThreadId, CASHFLOW-1234)");
        message.setStringProperty("GmmThreadId", "CASHFLOW-1234");
    }
});

This MessageAction is executed, as shown in the logs:

Setting message property (GmmThreadId, CASHFLOW-1234)


The reader uses a message selector to obtain this message. (using Spring's JmsTemplate v1 - an old version I know, but it's baked into our vendor's framework and we're compelled to use it.)

template.receiveSelected(queue, "GmmThreadId = 'CASHFLOW-1234' or GmmThreadId IS NULL");

The only messages on the queue are ones for which the logs show that the writer set the message property. In the logs for the reader, I enumerate the properties and also try to log the value of GmmThreadId. It also shows that the property GmmThreadId does not exist.

message property JMS_IBM_PutDate = 20111003
message property JMSXAppID = WebSphere MQ Client for Java
message property JMS_IBM_Format = MQSTR
message property JMS_IBM_PutApplType = 28
message property JMS_IBM_MsgType = 8
message property JMSXUserID = MUSR_MQADMIN
message property JMS_IBM_PutTime = 23551798
message property JMSXDeliveryCount = 2
message had GmmThreadId property of null

Note, if my message selector is only "GmmThreadId = 'CASHFLOW-1234'" then nothing is dequeued.

Using WebSphere MQ Explorer to view the message, I cannot find anywhere to view the application set message properties. The message type is MQSTR, if that makes any difference.

Both reader and writer applications are running in WebSphere v6.

Where am I going wrong?

1

1 Answers

3
votes

As indicated by this thread the message properties will be suppressed if the destination type is 'MQ'. For me, this is configured in the WebSphere App Server console. I changed the queue type to 'JMS' and the message properties were persisted.