<commit_before>---
layout: post
title: "Structuring events in a messaging system"
tags: [events, messages, distributed]
---

This post describes some general principles that can be used to create an event 
structure for a messaging system. They can be applied to any practical domain 
assuming that "events" concept is part of it.


## What is an event?

To better understand the structure of events it's good to know what is an 
_event_ in the context of some _messaging system_. In general we can classify 
any message as one of the following.

* _Task (or Job or Command) message._ By sending this message sender 
  specifically tells receiver what need to be done.

* _Data (or Document) message._ It contains some chuck of information that makes 
  sense for a given system. Sender transfer this data to receiver buy does not 
  specify what need to be done.

* _Event message._ This is a notification about some changes in the system.  
  Send just notifies receiver about this change. As with a Data message it does 
  not tell how receiver should react.

In some cases the distinction between Data and Event messages is blurry. Events 
can contain entire objects, typically for easier processing on the receiver's 
side. What's more important is that both data and events just provide some 
information without specific instructions about what need to be done with it.

This is a great architectural approach because it detaches places where change <commit_msg>adjusted post tags<commit_after>---
layout: post
title: "Structuring events in a messaging system"
tags: [events, messaging, distributedsystems]
---

This post describes some general principles that can be used to create an event 
structure for a messaging system. They can be applied to any practical domain 
assuming that "events" concept is part of it.


## What is an event?

To better understand the structure of events it's good to know what is an 
_event_ in the context of some _messaging system_. In general we can classify 
any message as one of the following.

* _Task (or Job or Command) message._ By sending this message sender 
  specifically tells receiver what need to be done.

* _Data (or Document) message._ It contains some chuck of information that makes 
  sense for a given system. Sender transfer this data to receiver buy does not 
  specify what need to be done.

* _Event message._ This is a notification about some changes in the system.  
  Send just notifies receiver about this change. As with a Data message it does 
  not tell how receiver should react.

In some cases the distinction between Data and Event messages is blurry. Events 
can contain entire objects, typically for easier processing on the receiver's 
side. What's more important is that both data and events just provide some 
information without specific instructions about what need to be done with it.

This is a great architectural approach because it detaches places where change 
{'fraction_non_alphanumeric': 0.03388681802778719, 'fraction_numerical': 0.0, 'mean_word_length': 4.063464837049743, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2124419', 'n_tokens_mistral': 710, 'n_tokens_neox': 680, 'n_words': 464}