# \[Broker\] multi-topic subscriptions

**URL:** <https://community.zeek.org/t/broker-multi-topic-subscriptions/4214>\
**Category:** Development\
**Tags:** development\
**Created:** [June 28, 2016, 7:27pm UTC](https://community.zeek.org/t/broker-multi-topic-subscriptions/4214 "2016-06-28T19:27:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthias\_Vallentin1](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/matthias_vallentin1/32/596_2.png) [@Matthias\_Vallentin1](https://community.zeek.org/u/Matthias_Vallentin1)\
**Post date:** [June 28, 2016, 7:27pm UTC](https://community.zeek.org/t/broker-multi-topic-subscriptions/4214/1 "2016-06-28T19:27:04Z")

</div>

If a broker endpoint subscribes to multiple topics, how many messages do  
you expect to receive? Consider this snippet:

&nbsp;&nbsp;context ctx;  
&nbsp;&nbsp;auto e = ctx.spawn\<blocking\>();  
&nbsp;&nbsp;e.subscribe("/foo");  
&nbsp;&nbsp;e.subscribe("/foo/bar");  
&nbsp;&nbsp;e.subscribe("/foo/bar/baz");  
&nbsp;&nbsp;e.publish("/foo/bar/baz", 4.2);

Should the endpoint receive exactly one message or the same message  
three times? Personally, I think use exactly-once delivery semantics  
would be most intuitive.

&nbsp;&nbsp;&nbsp;&nbsp;Matthias

---

<div class="post-metadata">

**Author:** ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)\
**Post date:** [June 29, 2016, 2:53pm UTC](https://community.zeek.org/t/broker-multi-topic-subscriptions/4214/2 "2016-06-29T14:53:10Z")

</div>

Yeah, seems most intuitive to me too.

Robin

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)\
**Post date:** [May 6, 2022, 3:43pm UTC](https://community.zeek.org/t/broker-multi-topic-subscriptions/4214/3 "2022-05-06T15:43:47Z")

</div>


