JMS2.0规范中文版

消息选择

许多消息传递应用程序需要过滤和分类,他们产生的消息。

在将消息发送到一个接收器的情况下,这可以以合理的效率通过把标准的消息中,并具有接收客户端丢弃那些它不感兴趣做

当一个消息被广播到多个客户端,它放置到标准的消息头,以便它是可见的JMS提供者变得非常有用。这允许提供者来处理多,否则将需要由应用程序进行的过滤和路由的工作。

JMS提供了一个工具,允许客户端消息选择委托给他们的JMS提供者。这简化了客户端的工作,并允许JMS提供者以消除时间和带宽他们原本浪费将消息发送到不需要他们的客户。

客户端安装应用程序特定的选择标准来使用消息属性的消息。客户端使用JMS消息选择器表达式指定消息的选择标准。

Many messaging applications need to filter and categorize the messages they produce. In the case where a message is sent to a single receiver, this can be done with reasonable efficiency by putting the criteria in the message and having the receiving client discard the ones it’s not interested in. When a message is broadcast to many clients, it becomes useful to place the criteria into the message header so that it is visible to the JMS provider. This allows the provider to handle much of the filtering and routing work that would otherwise need to be done by the application. JMS provides a facility that allows clients to delegate message selection to their JMS provider. This simplifies the work of the client and allows JMS providers to eliminate the time and bandwidth they would otherwise waste sending messages to clients that don’t need them. Clients attach application-specific selection criteria to messages using message properties. Clients specify message selection criteria using JMS message selector expressions.