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

Add ability to set message headers #57

Open
viktorprogger opened this issue Mar 5, 2023 · 6 comments
Open

Add ability to set message headers #57

viktorprogger opened this issue Mar 5, 2023 · 6 comments
Labels
type:enhancement Enhancement
Milestone

Comments

@viktorprogger
Copy link
Contributor

AMQP protocol allows to set message headers. Let's discuss necessity of adding this ability to the package.
Plus: it's very handy to store some metadata like metrics.
Minus: it's AMQP-specific feature, not available in other queue adapters.

@viktorprogger
Copy link
Contributor Author

What about sending Message metadata in headers instead of body?

@samdark
Copy link
Member

samdark commented Mar 5, 2023

How would you implement that in non-AMQP? By extending message body?

@xepozz
Copy link
Member

xepozz commented Mar 5, 2023

Metadata may be converted to message body as an additional structure

{"body": [1, 2, 3], "headers":[...]}

for non-AMQP brokers
and

Message: {"body": [1, 2, 3]}
Headers: [...]

or just

Message: [1, 2, 3]
Headers: [...]

@samdark
Copy link
Member

samdark commented Mar 6, 2023

Won't that mean that you won't be able to process message the same way in these cases?

@xepozz
Copy link
Member

xepozz commented Mar 6, 2023

It may be encapsulated into drivers. The queue api is clear and simple as it is at now. Headers will be added into the body only when drivers decides that it's broker doesn't support headers.
It works for any other metadata or features in general.

@samdark
Copy link
Member

samdark commented Mar 7, 2023

Yes, that could work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Enhancement
Projects
None yet
Development

No branches or pull requests

4 participants