没有看到我明确设置的消息属性(Spring/JMS/MQ) [英] Not seeing message properties that I set explicitly (Spring/JMS/MQ)

查看:145
本文介绍了没有看到我明确设置的消息属性(Spring/JMS/MQ)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

两个单独的进程正在通过MQ上的JMS进行通信.

Two separate processes are communicating via JMS over MQ.

作者设置字符串属性:

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

已执行此MessageAction,如日志中所示:

This MessageAction is executed, as shown in the logs:

Setting message property (GmmThreadId, CASHFLOW-1234)

阅读器使用消息选择器来获取此消息. (使用Spring的JmsTemplate v1-我知道的一个旧版本,但它已植入我们供应商的框架中,因此我们不得不使用它.)

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");

队列中唯一的消息是日志显示写入者设置了message属性的消息.在读者的日志中,我列举了属性,还尝试记录GmmThreadId的值.它还显示属性GmmThreadId不存在.

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

请注意,如果我的邮件选择器仅为"GmmThreadId = 'CASHFLOW-1234'",则不会使任何队列出队.

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

使用WebSphere MQ资源管理器查看消息,我找不到任何地方可以查看应用程序集消息属性.消息类型为MQSTR,如果有任何区别的话.

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.

读取器和写入器应用程序都在WebSphere v6中运行.

Both reader and writer applications are running in WebSphere v6.

我要去哪里错了?

推荐答案

此线程消息属性将被禁止.对我来说,这是在WebSphere App Server控制台中配置的.我将队列类型更改为"JMS",并且消息属性得以保留.

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.

这篇关于没有看到我明确设置的消息属性(Spring/JMS/MQ)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆