# Domain events In Discourse

**URL:** https://meta.discourse.org/t/domain-events-in-discourse/20765
**Category:** Feature
**Created:** [4 Outubro , 2014 18:10 UTC](https://meta.discourse.org/t/domain-events-in-discourse/20765 "2014-10-04T18:10:23Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Del\_Boy\_Trotter](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/del_boy_trotter/32/108857_2.png) [@Del\_Boy\_Trotter](https://meta.discourse.org/u/Del_Boy_Trotter)
#### Post date: [4 Outubro , 2014 18:10 UTC](https://meta.discourse.org/t/domain-events-in-discourse/20765/1 "2014-10-04T18:10:23Z")

</div>

is there any concept of domain events in discourse? We’d like our app to be notified of certain events within discourse.

If not we’ll be looking at creating this as some sort of extension but I do think there’d need to be code added to the main code in order to fire the events.

Ideally the aggregator would be generic so we (or anyone) can plug in their own mechanism for consuming or forwarding these events.

Anyone know anything about this?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [4 Outubro , 2014 21:58 UTC](https://meta.discourse.org/t/domain-events-in-discourse/20765/2 "2014-10-04T21:58:30Z")

</div>

Can you be more specific about what events you want to see?

---

<div class="post-metadata">

### Author: ![Del\_Boy\_Trotter](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/del_boy_trotter/32/108857_2.png) [@Del\_Boy\_Trotter](https://meta.discourse.org/u/Del_Boy_Trotter)
#### Post date: [5 Outubro , 2014 07:03 UTC](https://meta.discourse.org/t/domain-events-in-discourse/20765/3 "2014-10-05T07:03:10Z")

</div>

I guess it’s things that would be interesting to the user still in our app but outside of discourse. So off the top of my head:

- @mentions
- badge awarded
- etc

Basically whenever there is a notification in the header for a user - we could then listen out for these events (probably by subscribing to RabbitMQ topics) and forward the notifications in our header.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [5 Outubro , 2014 19:37 UTC](https://meta.discourse.org/t/domain-events-in-discourse/20765/4 "2014-10-05T19:37:41Z")

</div>

You can request `/notifications.json?silent=true&api_username=$username&api_key=$master_api_key` (FROM THE SERVER TO DISCOURSE - do not ship the master api key to clients)

This will give you the notifications, without marking them as seen (clearing the blue indicator).

(The master API key lets you perform requests as any user.)

---

<div class="post-metadata">

### Author: ![Del\_Boy\_Trotter](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/del_boy_trotter/32/108857_2.png) [@Del\_Boy\_Trotter](https://meta.discourse.org/u/Del_Boy_Trotter)
#### Post date: [5 Outubro , 2014 19:57 UTC](https://meta.discourse.org/t/domain-events-in-discourse/20765/5 "2014-10-05T19:57:31Z")

</div>

hmmm I’d rather do this out of process. Also we’d have to poll discourse for each user which is not something I’d like to get into.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [5 Outubro , 2014 20:06 UTC](https://meta.discourse.org/t/domain-events-in-discourse/20765/6 "2014-10-05T20:06:25Z")

</div>

Actually…

@sam is it possible for a MessageBus subscriber to receive all messages, regardless of the specified security settings? (The user\_ids/group\_ids)

Then your service could subscribe to all `/notifications/:userid` channels, or all `/topic/:id` channels, or…

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [5 Outubro , 2014 20:45 UTC](https://meta.discourse.org/t/domain-events-in-discourse/20765/7 "2014-10-05T20:45:01Z")

</div>

There is no override subscribe all (admin only) thing, but I am fine to add that to message bus if people want to submit a PR.

---

<div class="post-metadata">

### Author: ![Del\_Boy\_Trotter](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/del_boy_trotter/32/108857_2.png) [@Del\_Boy\_Trotter](https://meta.discourse.org/u/Del_Boy_Trotter)
#### Post date: [6 Outubro , 2014 06:06 UTC](https://meta.discourse.org/t/domain-events-in-discourse/20765/8 "2014-10-06T06:06:14Z")

</div>

Looks like I’ll be taking my 1st dive into ruby!

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [4 Dezembro , 2025 11:32 UTC](https://meta.discourse.org/t/domain-events-in-discourse/20765/9 "2025-12-04T11:32:27Z")

</div>


