Azure Service Bus – 多个命名空间 Java

huangapple go评论76阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2020年9月14日 14:21:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/63879031.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定