使用特殊字符时,JMS编码的消息选择器不匹配 [英] JMS encoded message selector not matching when using special characters

查看:124
本文介绍了使用特殊字符时,JMS编码的消息选择器不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个使用请求-回复模式的应用程序(客户端和服务器).

I have 2 applications (client and server) using a request-reply pattern.

客户端向服务器发送请求,消息ID设置为如下所示:ID=Hostname-52991-1357677886768-3:1:2:1:1.

The client sends a request to the server the message ID is set to something like this: ID=Hostname-52991-1357677886768-3:1:2:1:1.

现在,客户端必须收听相关ID设置为相同值的消息.由于该值包含特殊字符(:),因此我必须使用UTF-8对值进行编码.

Now the client has to listen to a message with a correlation ID set to the same value. Since the value contains special characters (:) I have to encode the value (using UTF-8).

设置JMS选择器,它是一个SQL 92谓词,用于过滤代理中的消息.您可能需要对特殊字符进行编码,例如=如%3D

Sets the JMS Selector, which is an SQL 92 predicate that is used to filter messages within the broker. You may have to encode special characters such as = as %3D

所以我想选择器应该看起来像JMSCorrelationID='ID=Hostname-52991-1357677886768-3:1:2:1:1',而编码选择器应该看起来像JMSCorrelationID='ID%3AHostname-52991-1357677886768-3%3A1%3A2%3A1%3A1'.

So the selector should look like JMSCorrelationID='ID=Hostname-52991-1357677886768-3:1:2:1:1' and the encoded selector should look like JMSCorrelationID='ID%3AHostname-52991-1357677886768-3%3A1%3A2%3A1%3A1' I guess.

我已经奋斗了几个小时,搜寻并阅读了我能找到的所有内容,但我无法使该功能正常工作,这让我发疯了.

I have struggled for a couple of hours now and searched and read everything I could find but I cannot get this thing to work and it's driving me nuts.

仅使用abcd之类的ASCII字符即可.

Using only ASCII characters like abcd works.

推荐答案

您的JMS选择器选择器已经过HTML编码,因此无法与基础系统一起使用(因为它永远不会与消息匹配).表达式JMSCorrelationID ='ID = Hostname-52991-1357677886768-3:1:2:1:1'应该可以正常工作.

Your JMS selector selector is being HTML encoded which will not work with the underlying system(as it will never match a message). The expression JMSCorrelationID='ID=Hostname-52991-1357677886768-3:1:2:1:1' should work as is.

这篇关于使用特殊字符时,JMS编码的消息选择器不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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