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

added headers subdirective for nats_request and nats_subscribe #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sapergus
Copy link

@sapergus sapergus commented Aug 2, 2024

Added an optional sub-directive named 'headers' to nats_request and nats_subscribe that allows a user to enable or disable adding HTTP headers to a NATS message. The default value for the new 'headers' sub-directive is false, i.e. no headers are added to the message.

@skurfuerst
Copy link
Member

Thanks @sapergus for your PR ❤️

I am a bit hesitant to set the headers default to false, because this would be a breaking (and rather non-obvious) change. My thinking so far was that having the headers around usually does not hurt, if one does not read them.

What is your use case of having them removed? // And second, would you be OK with having "headers" true by default; or at least include the X-NatsBridge-... headers always?

All the best,
Sebastian

@sapergus
Copy link
Author

sapergus commented Aug 2, 2024

Hello,

I guess the answer to your question is lack of knowledge about NATS. I used the nats client to test the plugin and could not find any flags for the subscribe command that disabled printing the headers, and I did not think of checking the Go API.

But, after reading the documentation it is clear to me now that one can simply ignore reading the headers. However, I still would like to control if the headers are added to the message or not, but I don't mind if the default value for 'headers' is set to true.

Br
Per

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

Successfully merging this pull request may close these issues.

3 participants