Azure ServiceBus SAS key for a subscription

时光毁灭记忆、已成空白 提交于 2019-12-24 07:52:04

问题


I have the following architecture: 1 topic where a publisher publishes messages and 3 subscriptions. All messages are dispatched in the 3 subscriptions thanks to a "1=1" rule. The 3 subscriptions are created to provide the message published to 3 different apps. I have a SAS key for the publisher with the "Write" permission on the topic. I now need to create 3 SAS keys with "listen" permission for the 3 apps but I saw that I can't associate a key with a subscription, only with a topic or at the namespace level. What I'm looking for is a way to avoid the app #1 to listen to the subscription that is not dedicated to it. Is it possible to do that?


回答1:


The only way that I'm aware of to achieve that would be by having three separate "listener" topics with Listen and Send SAS keys.

In order to decouple this from your publisher application you could keep the "publish" topic with it's Send SAS key and create a Listen subscription and SAS key and write a small second "broadcaster" application which simply reads the "publish" topic and distributes the messages to the three "listener" topics.

That way only you would know the all 4 Send SAS keys and the Listen SAS key for the primary "publish" topic and you can distribute the three other Listen SAS keys independently.

I'm sure you probably considered this but felt there must be an easier way! :-)

I had a quick look at Event Hubs and Relays but Relays seemed inappropriate and Event Hubs may provide the functionality but it's not really what they're intended for, I believe. I think they also cost a lot.



来源:https://stackoverflow.com/questions/47152952/azure-servicebus-sas-key-for-a-subscription

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!