英文:
Azure Service Bus - Multiple namespaces Java
问题
我有以下情景:
- 多个微服务
- 每个微服务可以通过 Azure Service Bus 向任何其他微服务发送消息
- 应用中注册的每个用户都有自己的服务总线
我正在使用 SpringBoot 开发这个应用。
在发送消息时,我成功地通过在创建 QueueClients Bean 时使用 @RequestScope
来在运行时连接到用户命名空间。问题是,我不知道如何使所有接收器都能够监听所有命名空间。
我能找到的唯一信息是 C# 的一个库(https://docs.particular.net/samples/azure/custom-partitioning-asb/)。
在 SpringBoot 中有可能实现这一点吗?
英文:
I have the following scenario:
- multiple microservices
- each microservice can send messages to any other microservice thought Azure Service Bus
- every user that is registered in the app has its own service bus
I'm developing the app using SpringBoot.
When sending a message, I managed to connect on runtime to a user namespaces using @RequestScope
when creating QueueClients
bean. The issue is that I don't know how to make all receivers to listen to all namespaces.
The only thing that I could find was a library for C#(https://docs.particular.net/samples/azure/custom-partitioning-asb/).
There is any possibility to do this in SpringBoot?
答案1
得分: 1
Azure Service Bus没有支持跨命名空间引用的功能。您的应用程序必须显式地连接到所有命名空间并在它们之间交换消息。这意味着需要针对每个命名空间分别打开独立的客户端/连接。
应用中注册的每个用户都有自己的服务总线
这并不是典型的命名空间使用方式。我建议您重新审查设计和/或技术使用。
英文:
Azure Service Bus does not have a feature that would support cross-namespace references. Your application would have to explicitly connect to all the namespaces and exchange the messages between those. That will mean opening separate clients/connections to the namespaces.
> every user that is registered in the app has its own service bus
This is not quite a typical use of the namespaces. I would suggest reviewing your design and/or technology use.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论