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

Feature request: support headers, like ActiveMQ #203

Open
ecerichter opened this issue Apr 4, 2024 · 1 comment · May be fixed by #338
Open

Feature request: support headers, like ActiveMQ #203

ecerichter opened this issue Apr 4, 2024 · 1 comment · May be fixed by #338
Labels
enhancement New feature or request

Comments

@ecerichter
Copy link

ecerichter commented Apr 4, 2024

Would be a nice addition to support headers, similar to what ActiveMQ have.
Headers are a KV store with two main features:

  1. Header "duplicate_detection" (the name of the header is _AMQ_DUPL_ID in ActiveMQ): if producer try to add two messages in same queue with same value for this header, the message is silent discarded (because it's already in the queue, there is no need to add it again) - I believe this can be easly implemented using unique constraints over json attribute, and insert ... on conflict do nothing.
  2. Custom headers: for example, if a microservice has to discard a message for any reason, it can enrich the message with a explanatory header and send it to archives, making easier for developers to analyze why and when certain messages are being discarded. The advantage on using headers in this case is that is possible to enrich the message in the queue without changing anything in the original body.
  3. Using ActiveMQ as example, there are a lot of "standard" headers that have been added while ActiveMQ matured. For reference, a list of current headers can be found in JavaDoc for Message class (https://activemq.apache.org/components/artemis/documentation/javadocs/javadoc-latest/org/apache/activemq/artemis/api/core/Message.html)

One proposal would be to have one column to store headers in jsonb - and use the "unique index" on json attribute in case of duplicate detection.

Thanks in advance for considering this nice to have :-)

@ChuckHend
Copy link
Member

I like this a lot, 1) and 2) would be very useful in many cases. I'll need to read up on the headers used in ActiveMQ more.

Adding a column headers jsonb seems reasonable. Do you have any thoughts on how what the API (.send() and .read()) would look like? Ideally usage of unique headers would be optional.

Great idea @ecerichter, thanks for bringing this up!

@ChuckHend ChuckHend added the enhancement New feature or request label May 28, 2024
@v0idpwn v0idpwn linked a pull request Nov 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants