You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When publishing messages we're only attaching a bare bones set of AMQP properties to the message envelope; either MessageProperties.BASIC or PERSISTENT_BASIC. Apart from the persistence property it sets the content-type property to application/octet-stream and the priority to zero.
We should set the content-type property to application/json and the timestamp property to the event's time (or possibly the current time if the event time isn't readily available).
Motivation
The content-type and timestamp properties convey useful information.
Exemplification
An application that stores messages sent on a RabbitMQ bus in a document database will be able to do the right thing without having any knowledge about Eiffel. Specifically, with an application/json content-type it'll understand that there's a JSON payload to deserialize and store, and the timestamp property allows it to timestamp the document correctly.
Possible Drawbacks
No drawbacks apart from the increased complexity of a five-line patch (plus whatever needs to be done in the tests, if anything).
The text was updated successfully, but these errors were encountered:
BasicProperties msgProps = MessageProperties.BASIC;
msgProps.builder().contentType("application/json");
msgProps.builder().timestamp(new Date()); // or the event time
Description
When publishing messages we're only attaching a bare bones set of AMQP properties to the message envelope; either MessageProperties.BASIC or PERSISTENT_BASIC. Apart from the persistence property it sets the content-type property to application/octet-stream and the priority to zero.
We should set the content-type property to application/json and the timestamp property to the event's time (or possibly the current time if the event time isn't readily available).
Motivation
The content-type and timestamp properties convey useful information.
Exemplification
An application that stores messages sent on a RabbitMQ bus in a document database will be able to do the right thing without having any knowledge about Eiffel. Specifically, with an application/json content-type it'll understand that there's a JSON payload to deserialize and store, and the timestamp property allows it to timestamp the document correctly.
Possible Drawbacks
No drawbacks apart from the increased complexity of a five-line patch (plus whatever needs to be done in the tests, if anything).
The text was updated successfully, but these errors were encountered: