0

I'm currently developing an application in C# using the IBM Websphere MQ API (v7.5) whose main goal is to getting messages from a queue and store them in a database. All is well, I know to get and browse messages. But I must process messages differently according to their priority.

Is there any "simple" way to get only messages with a given priority ?

I don't want to use a dirty trick like browsing through all the messages, storing the ID of the messages I'm interested in, and then getting them one by one. I read in the MQ documentation that we can use a selector string to browse through particular messages using an SQL like syntax, but I don't find how to do it in C#.

Thanks a lot for your help !

4

1 回答 1

1

到目前为止,在 MQ .NET 中,您可以使用MQC.MQMO_MATCH_MSG_IDMQC.MQMO_MATCH_CORREL_ID匹配选项来获取与消息 ID 或相关 ID 匹配的消息。Priority无法获取匹配 a 的消息。

或者,您切换到XMS .NET允许使用 SQL92 样式选择字符串创建消费者的使用。例如,您可以使用选择字符串创建消费者,"JMSPriority > 3 AND manufacturer = 'Jaguar'"以仅接收具有JMSPriority3 且manufacturer名称为 Jaguar 的消息。

于 2013-08-08T10:04:44.460 回答