服务总线规则中的简单过滤器不起作用
Simple filter in Service Bus Rule not working
我有一个非常简单的要求,即在订阅上设置规则,以便在优先级较低时接收消息。没想到这很难做到而且根本行不通
下面是我的留言
{
"messageId": "90db0000-d0ef-aeb6-cb37-08d86a2d0015",
"conversationId": "90db0000-d0ef-aeb6-6512-08d86a2d0018",
"sourceAddress": "ADDRESS",
"destinationAddress": "sb://MYBUS.servicebus.windows.net/my-topic",
"messageType": [
"urn:message:Messaging.Services.Models:MyMessage"
],
"message": {
"messageIdentifier": "f79345cb-ce6a-445c-85b6-d8003eb52046",
"priority": "LOW"
},
"sentTime": "2020-10-06T19:21:18.0426039Z",
"headers": {},
"host": {
"machineName": "MACHINE",
"processName": "Application",
"processId": 27640,
"assembly": "Application",
"assemblyVersion": "1.0.0.0",
"frameworkVersion": "3.1.8",
"massTransitVersion": "7.0.4.0",
"operatingSystemVersion": "Microsoft Windows NT 6.2.9200.0"
}
}
我以为语法很简单 message.priority = "LOW"?
然后我尝试针对邮件正文本身创建一个规则,在 destinationAddress 上进行过滤,但它也没有接收到任何邮件
这真的很令人沮丧,有人可以帮忙吗?
我正在使用服务总线资源管理器
保罗
Azure 服务总线筛选器在 headers/properties 上运行,无法访问消息 body/payload。您需要将 message:priority
提升为 header。
同意前面的回答。
从 MS Docs > 所有过滤器评估消息属性。过滤器无法评估消息正文。
看这里:https://docs.microsoft.com/en-us/azure/service-bus-messaging/topic-filters
我有一个非常简单的要求,即在订阅上设置规则,以便在优先级较低时接收消息。没想到这很难做到而且根本行不通
下面是我的留言
{
"messageId": "90db0000-d0ef-aeb6-cb37-08d86a2d0015",
"conversationId": "90db0000-d0ef-aeb6-6512-08d86a2d0018",
"sourceAddress": "ADDRESS",
"destinationAddress": "sb://MYBUS.servicebus.windows.net/my-topic",
"messageType": [
"urn:message:Messaging.Services.Models:MyMessage"
],
"message": {
"messageIdentifier": "f79345cb-ce6a-445c-85b6-d8003eb52046",
"priority": "LOW"
},
"sentTime": "2020-10-06T19:21:18.0426039Z",
"headers": {},
"host": {
"machineName": "MACHINE",
"processName": "Application",
"processId": 27640,
"assembly": "Application",
"assemblyVersion": "1.0.0.0",
"frameworkVersion": "3.1.8",
"massTransitVersion": "7.0.4.0",
"operatingSystemVersion": "Microsoft Windows NT 6.2.9200.0"
}
}
我以为语法很简单 message.priority = "LOW"?
然后我尝试针对邮件正文本身创建一个规则,在 destinationAddress 上进行过滤,但它也没有接收到任何邮件
这真的很令人沮丧,有人可以帮忙吗?
我正在使用服务总线资源管理器
保罗
Azure 服务总线筛选器在 headers/properties 上运行,无法访问消息 body/payload。您需要将 message:priority
提升为 header。
同意前面的回答。 从 MS Docs > 所有过滤器评估消息属性。过滤器无法评估消息正文。 看这里:https://docs.microsoft.com/en-us/azure/service-bus-messaging/topic-filters