Service Broker 外部激活器...在 2 个队列上激活?
我有 2 个队列,还有更多队列...我想使用外部激活器从外部激活这些队列。
当我编辑 EAService.config 来激活队列#1 时,它工作得很好。
当我编辑 EAService.config 来激活队列#2 时,它工作得很好。
如果我将两者都放入配置中,则只有第一个列出的才会被激活。
两个队列实际上都是由同一个 exe 处理的...不起作用的示例是这个...
<NotificationServiceList>
<NotificationService name="my_notif_svc1" id="100" enabled="true">
<Description>my notification service 1</Description>
<ConnectionString>
<Unencrypted>server=my_pc01;database=my_db;Application Name=External Activator;Integrated Security=true;</Unencrypted>
</ConnectionString>
</NotificationService>
<NotificationService name="my_notif_svc2" id="100" enabled="true">
<Description>my notification service 2</Description>
<ConnectionString>
<Unencrypted>server=my_pc01;database=my_db;Application Name=External Activator;Integrated Security=true;</Unencrypted>
</ConnectionString>
</NotificationService>
</NotificationServiceList>
<ApplicationServiceList>
<ApplicationService name="myMessageApp1" enabled="true">
<OnNotification>
<ServerName>my_pc01</ServerName>
<DatabaseName>my_db</DatabaseName>
<SchemaName>dbo</SchemaName>
<QueueName>my_user_queue1</QueueName>
</OnNotification>
<LaunchInfo>
<ImagePath>c:\test\myMessageReceiver.exe</ImagePath>
<CmdLineArgs>whatever cmd-line arguments you need to pass to your receiver application</CmdLineArgs>
<WorkDir>c:\test</WorkDir>
</LaunchInfo>
<Concurrency min="1" max="4" />
</ApplicationService>
<ApplicationService name="myMessageApp2" enabled="true">
<OnNotification>
<ServerName>my_pc01</ServerName>
<DatabaseName>my_db</DatabaseName>
<SchemaName>dbo</SchemaName>
<QueueName>my_user_queue2</QueueName>
</OnNotification>
<LaunchInfo>
<ImagePath>c:\test\myMessageReceiver.exe</ImagePath>
<CmdLineArgs>whatever cmd-line arguments you need to pass to your receiver application</CmdLineArgs>
<WorkDir>c:\test</WorkDir>
</LaunchInfo>
<Concurrency min="1" max="4" />
</ApplicationService>
</ApplicationServiceList>
另外我不明白 id="100" 正在做什么...我尝试使用相同的 # 和不同的 #...即 100 & 101 但这没有什么区别。激活器服务仅适用于“ApplicationServiceList”
帮助中列出的第一个服务!
I have 2 queues and more to come... I want to have those queues externally activated using the external activator.
When I edit the EAService.config to activate queue#1 it works just fine.
When I edit the EAService.config to activate queue#2 it works just fine.
If I put both in the config only the one listed first gets activated.
Both queues are actually getting processed by the same exe... and example of what doesn't work is this...
<NotificationServiceList>
<NotificationService name="my_notif_svc1" id="100" enabled="true">
<Description>my notification service 1</Description>
<ConnectionString>
<Unencrypted>server=my_pc01;database=my_db;Application Name=External Activator;Integrated Security=true;</Unencrypted>
</ConnectionString>
</NotificationService>
<NotificationService name="my_notif_svc2" id="100" enabled="true">
<Description>my notification service 2</Description>
<ConnectionString>
<Unencrypted>server=my_pc01;database=my_db;Application Name=External Activator;Integrated Security=true;</Unencrypted>
</ConnectionString>
</NotificationService>
</NotificationServiceList>
<ApplicationServiceList>
<ApplicationService name="myMessageApp1" enabled="true">
<OnNotification>
<ServerName>my_pc01</ServerName>
<DatabaseName>my_db</DatabaseName>
<SchemaName>dbo</SchemaName>
<QueueName>my_user_queue1</QueueName>
</OnNotification>
<LaunchInfo>
<ImagePath>c:\test\myMessageReceiver.exe</ImagePath>
<CmdLineArgs>whatever cmd-line arguments you need to pass to your receiver application</CmdLineArgs>
<WorkDir>c:\test</WorkDir>
</LaunchInfo>
<Concurrency min="1" max="4" />
</ApplicationService>
<ApplicationService name="myMessageApp2" enabled="true">
<OnNotification>
<ServerName>my_pc01</ServerName>
<DatabaseName>my_db</DatabaseName>
<SchemaName>dbo</SchemaName>
<QueueName>my_user_queue2</QueueName>
</OnNotification>
<LaunchInfo>
<ImagePath>c:\test\myMessageReceiver.exe</ImagePath>
<CmdLineArgs>whatever cmd-line arguments you need to pass to your receiver application</CmdLineArgs>
<WorkDir>c:\test</WorkDir>
</LaunchInfo>
<Concurrency min="1" max="4" />
</ApplicationService>
</ApplicationServiceList>
additionally I don't understand what the id="100" is doing... I tried having same # and different #... ie 100 & 101 but it didn't make a difference. The activator service only works for the first one listed in the "ApplicationServiceList"
help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我找到了我的问题...
来自文档
我是上面列出的两个通知服务(my_notif_svc1 和 my_notif_svc2)。我切换了我的事件通知(创建事件通知...)以利用相同的“TO SERVICE”,现在它可以工作了。
因此,您必须为外部激活器使用一项“服务”,但您可以为指向该服务的多个队列创建多个事件通知。
我仍然认为我的设置方式应该有效,但这绝对有效......
I figured out my problem...
From the documentation
I was two notification services (my_notif_svc1 & my_notif_svc2) listed above. I switched my event notifications (create event notivation ... ) to utilize the same "TO SERVICE" and now it works.
So you have to utilize one "service" for external activator but you can create multiple Event Notifications for multiple queues which point to that service.
I still think the way I had it set up it should work but this definitely works...
我也遇到了同样的问题,如果微软能给出官方回应,说明为什么以及他们是否会尊重 SSBEA 中列出的多个通知服务,而不仅仅是列表中的第一个,那就太好了。最后,我们采用了相同的解决方案,这里有一个有用的代码片段,可用于动态获取 Guid 并将队列激活事件设置为单个服务 (ServiceBrokerNotification.NotificationService)。
I also ran into this same problem and it would be nice to have an official response from Microsoft as to why and if they will honor multiple notification services listed in SSBEA and not just the first one in the list. In the end we went with the same solution, and here is a helpful snippet to use to dynamically to get the Guid and setup the queue activation event to a SINGLE service (ServiceBrokerNotification.NotificationService).