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

标签 java ibm-mq spring-jms

是否可以使用 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/

相关文章:

Spring JMS : each DefaultMessageListenerContainer deployment takes longer than one before

java - jvisualvm 连接到远程 jstatd 不显示应用程序

java - 在java中使用时间单位

c++ - IBM MQ 回调函数调用等待某些作业完成

javax.jms.JMSSecurityException : MQJMS2008: failed to open MQ queue

spring-boot - 使用 spring-JMS 和 spring cloud sleuth 时的 BeanNotOfRequiredTypeException

Spring JMS URL - 将 SSL 转换为 TCP

java - IntelliJ如何将模块添加到现有模块

java - "throttled concurrency"在Java中意味着什么?

c# - MQQueueManager 消息池