Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
512 views
in Technique[技术] by (71.8m points)

azure - 天蓝色服务总线订阅是否像队列一样?(Does an azure service bus subscription act like a queue?)

This may be a stupid question, but I can't find a definite unambiguous answer by reading the documentation.

(这可能是一个愚蠢的问题,但我无法通过阅读文档找到明确的明确答案。)

This is what I understand from the documentation:

(这是我从文档中了解的内容:)

So assume you have a queue, you can send multiple messages to it, and have multiple clients/readers connected to the queue.

(因此,假设您有一个队列,则可以向它发送多条消息,并且有多个客户端/阅读器连接到该队列。)

In this case each message will be received by just one client/reader.

(在这种情况下,每个消息将仅由一个客户端/阅读器接收。)

Now assume you have made a topic, and send messages to that.

(现在假设您已经创建了一个主题,并向该主题发送消息。)

And you have several clients/readers who each make there own subscription to the topic;

(并且您有几个客户/阅读器,每个客户/阅读器都对该主题进行了订阅。)

In this case each client/reader will receive all the messages send to the topic.

(在这种情况下,每个客户端/阅读器都会收到发送给该主题的所有消息。)

But this is what I want to know:

(但这是我想知道的:)

Is it possible to create a topic, with one subscription;

(是否可以创建一个订阅主题?)

and then connect multiple clients/readers to that same subscription?

(然后将多个客户端/阅读器连接到同一订阅?)

And if so;

(如果是这样;)

can I then assume that each message will be received by only one client/reader?

(然后我可以假设每条消息将仅由一个客户端/阅读器接收吗?)

(Or, is this not possible, and do we need to create a queue; then link that queue to the subscription, and create multiple readers on the queue.)

((或者,这是不可能的,我们是否需要创建一个队列;然后将该队列链接到订阅,并在该队列上创建多个读取器。))

PS;

(PS;)

I know that it makes no sense to have a topic with only one subscription.

(我知道只订阅一个主题就没有意义。)

What I actually have in mind is a topic with multiple subscriptions which each may have zero, one, or more clients reading from it.

(我真正想到的是一个具有多个订阅的主题,每个订阅可能有零个,一个或多个客户端从中读取内容。)

  ask by Frederick Grumieaux translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Your understanding of the documentation is perfectly correct as you said.

(正如您所说,您对文档的理解是完全正确的。)

For your question, you should create a Topic with multiple subscriptions and then each client can receive messages allocated to them via the topic.

(对于您的问题,您应该创建一个具有多个订阅的主题,然后每个客户端都可以接收通过该主题分配给他们的消息。)

Actually, Service Bus topics and subscriptions support a publish/subscribe messaging communication model.

(实际上,服务总线主题和订阅支持发布/订阅消息传递通信模型。)

When using topics and subscriptions, components of a distributed application do not communicate directly with each other;

(使用主题和订阅时,分布式应用程序的组件不会彼此直接通信;)

instead, they exchange messages via a topic, which acts as an intermediary between the two.

(相反,它们通过主题交换消息,该主题充当两者之间的中介。)

在此处输入图片说明

if you do not want to use the above model, you can go for eventhub , which will suit your requirement.

(如果您不想使用上述模型,则可以选择eventhub ,它会满足您的要求。)

you can create Partitions and Applications as you need.

(您可以根据需要创建分区和应用程序。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...