gpt4 book ai didi

java - 带有基于内容过滤器的 JMS

转载 作者:行者123 更新时间:2023-12-04 10:35:41 25 4
gpt4 key购买 nike

是否可以使用 JMS 进行基于内容的过滤?

IBM MQ 发布/订阅似乎允许基于内容的过滤
https://www.ibm.com/support/knowledgecenter/en/SSKM8N_8.0.0/com.ibm.etools.mft.doc/bq13460_.htm
https://www.ibm.com/support/knowledgecenter/en/SSKM8N_8.0.0/com.ibm.etools.mft.doc/bq13360_.htm

我试图用我的 JMSListener 找到一种方法来过滤 Body 元素,但我无法让它工作..

最佳答案

IBM MQ 不能直接根据正文进行过滤,只能根据消息属性进行过滤。 IBM 声明扩展消息选择提供程序可以根据消息有效负载进行消息选择,但据我所知,唯一可用的扩展消息选择提供程序是 ACE/IIB/WMB。

请查看 IBM 知识中心页面 IBM MQ 9.1.x>IBM MQ>Developing applications>Developing JMS and Java applications>Using IBM MQ classes for JMS>Writing IBM MQ classes for JMS applications>JMS messages>Message selectors in JMS :

A property value might duplicate a value in a message body. JMS does not define a policy for what might be made into a property. However, application developers must be aware that JMS providers probably handle data in a message body more efficiently than data in message properties. For best performance, applications must use message properties only when they need to customize a message header. The primary reason for doing this is to support customized message selection.

A JMS message selector allows a client to specify the messages that it is interested in by using the message header. Only messages with headers that match the selector are delivered.

Message selectors cannot refer to message body values.

A message selector matches a message when the selector evaluates to true when the message header field and property values are substituted for their corresponding identifiers in the selector.

A message selector is a String, with syntax that is based on a subset of the SQL92 conditional expression syntax. The order in which a message selector is evaluated is from left to right within a precedence level. You can use parentheses to change this order. Predefined selector literals and operator names are written here in uppercase; however, they are not case-sensitive.



另请查看 IBM 知识中心页面 IBM MQ 9.0.x>IBM MQ>Developing applications>Application development concepts>IBM MQ messages>Selecting messages from queues>Selecting on the content of a message

It is possible to subscribe based on a selection of message payload content (also known as content filtering), but the decision about which messages should be delivered to such a subscription cannot be performed directly by IBM® MQ; instead an extended message selection provider, for example IBM Integration Bus, is required to process the messages.

关于java - 带有基于内容过滤器的 JMS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60195044/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com