Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional AMQP properties should be set #183

Open
magnusbaeck opened this issue Dec 2, 2019 · 2 comments
Open

Additional AMQP properties should be set #183

magnusbaeck opened this issue Dec 2, 2019 · 2 comments
Labels
enhancement New or extended features. good first issue Good for newcomers.

Comments

@magnusbaeck
Copy link
Member

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).

@SantoshNC68
Copy link
Member

You mean like this ??

BasicProperties msgProps = MessageProperties.BASIC;
msgProps.builder().contentType("application/json");
msgProps.builder().timestamp(new Date()); // or the event time

@magnusbaeck
Copy link
Member Author

Yes, something like that.

@SantoshNC68 SantoshNC68 added enhancement New or extended features. good first issue Good for newcomers. labels Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New or extended features. good first issue Good for newcomers.
Projects
None yet
Development

No branches or pull requests

2 participants