As we dont wish to store every message, we just update the messages content as soon as a day. We in some cases have polymorphic messages. This implies we are sending out different kinds of entities inside the very same message type. For instance, a “sample_message” can be of type “run_session”, “sleep_session” or others. We save just one example per entity type.We know who the manufacturer of a message is, as it belongs to the message payload (see how we specified our message content). Whenever a document is composed to mongodb, we also update the consumers asynchronously. We accomplished this by querying the Rabbitmq API configuration by means of a HTTP request (using the all-configuration path), parsing it and updating all consumers of all our kept messages. Details about “customers” can be discovered in the first blog site post in this series.Building an easy Web-InterfaceTo be able to access the stored details without querying the database directly, we built an easy web user interface. Basically, the overview looks comparable to the previous matrix in the wiki. It reveals all subjects grouped together by the producer.When accessing a topic, the subject information are revealed, with all the consumers again for this specific topic. This likewise implies the consumers of a topic can be different in the details view, as e.g.” samples.created.completed” messages are consumed by other services than “samples.updated.altered”. This topic detail view also permits to add some description to the topic.As pointed out above, we store an example message for every topic and every entity type as soon as a day. These can be revealed too by broadening the matching entity link below.Making Manual Message Documentation Obsolete With this service in place, we had the ability to deprecate the message documentation in the wiki. Even if we erase information stored in the message doc service, it is automatically recreating all the information. The only thing which would be lost are the extra descriptions per topic which were included by hand. This basic service, with less than 1000 lines of code in general, made manual documents of messages and its material outdated, and our life easier. ***.
Written by Martin Führlinger, Software Engineer BackendALL ABOUT MESSAGE BUSWelcome to the 6th post in this message bus associated article series. I highly advise reading the others too, to get the full context. These are: Now, I want to supply more insights into our paperwork around messages and how we automated this.Message DocumentationDocumentation is hard. No matter who you ask, paperwork is always difficult to create and most essential keep up to date. As constantly, we started with recording our messages in our business wikis understanding space. Whenever new messages were added or existing ones altered, somebody needed to add or upgrade them. The message topics were noted in a matrix, containing the manufacturer, the subjects, the customers, and some additional notes. It appeared like this: This procedure was slow and error-prone. We wanted to enhance this. How to Automate Documentation During one of our Day of New Ideas (DONIs), some associates and myself started to deal with a little service to instantly record the existing messages in our system. We developed a pretty easy service, named MessageDoc, just listening to all possible messages, so to all routing keys (discover information about routing here), by listening to #. #. Whenever we get a message, we parse it and store its information. This implies we save a file in a small MongoDB containing the messages meta data, like the manufacturer, the message itself and some more qualities. This is done per subject. The flow of saving and receiving can be seen in the following diagram.To see how this appears like in our database, here is an example: Composed by Martin Führlinger, Software Engineer BackendALL ABOUT MESSAGE BUSWelcome to the 6th post in this message bus related blog site post series. The message topics were listed in a matrix, consisting of the producer, the topics, the customers, and some extra notes. Whenever we get a message, we parse it and keep its details.
” producer”: “samples”,.
” description”: “”,.
” consumers”: [& lt; list of customers&& gt;
.],.” entities”: [” type”: “run_session”,.
” updated_at”: ISODate(” 2020-11-11T14:56:02.304 Z”),.
” example”: && lt; complete message payload&& gt;,.
” variation”: 4124,.
” created_at”: ISODate(” 2019-11-28T11:15:26.105 Z”),.
” updated_at”: ISODate(” 2020-11-12T06:00:12.950 Z”).
Written by Martin Führlinger, Software Engineer BackendALL ABOUT MESSAGE BUSWelcome to the 6th post in this message bus associated blog site post series. The message subjects were listed in a matrix, including the producer, the topics, the consumers, and some additional notes. As we dont want to save every single message, we only upgrade the messages content once a day. We store only one example per entity type.We know who the producer of a message is, as it is part of the message payload (see how we defined our message material). Even if we delete data stored in the message doc service, it is immediately recreating all the information.