简体   繁体   English

JMS消息体字符串上的Xquery

[英]Xquery on JMS message body string

I'm working on building a few JMS triggers in webMethods. 我正在努力在webMethods中构建一些JMS触发器。

I would like to filter my messages based on certain conditions in the payload of the message which is part of JMS Message body string. 我想根据消息的有效负载中的某些条件过滤我的消息,该消息是JMS消息体字符串的一部分。 As I understand JMS message selector will not do this filtering. 据我所知,JMS消息选择器不会进行此过滤。 I'm trying to see if Xquery is able to do this for me. 我试图看看Xquery是否能够为我做到这一点。

Any idea if Xquery can extract the value of a field hidden inside an XML (which is present inside the JMS Message body string)? 知道Xquery是否可以提取隐藏在XML中的字段的值(它存在于JMS消息体字符串中)?

JMS triggers cannot filter on values other than those in the JMS message header. JMS触发器不能过滤除JMS消息头中的值之外的值。

To achieve what you want you can either: 要实现您的目标,您可以:

  1. Extract the value you want to filter on and add it to the JMS message header prior to enqueuing the message, or 提取要筛选的值,并在将消息排入队列之前将其添加到JMS消息头,或者
  2. Check the JMS message body yourself in your trigger service, and decide whether to process the message or ignore it depending on the result of your check. 在触发器服务中自行检查JMS消息体,并根据检查结果决定是处理消息还是忽略消息。

By spec, that's not supported. 按规格,这是不支持的。 I suppose some JMS impl might have a proprietary feature like this (ActiveMQ perhaps ?), but you should probably look at implementing a message router like Apache Camel or Spring Integration. 我想一些JMS impl可能有像这样的专有功能(也许是ActiveMQ?),但你应该看看实现像Apache Camel或Spring Integration这样的消息路由器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM