Skip to content

Conversation

ramonberrutti
Copy link
Contributor

@ramonberrutti ramonberrutti commented Jul 1, 2024

Add DeliverBodies, which allows a consumer to be updated with headersOnly: false

This change will also be helpful for Nack: https://github.com/nats-io/nack/blob/main/controllers/jetstream/consumer.go#L408-L410

consumers.go Outdated
@@ -368,6 +368,14 @@ func DeliverHeadersOnly() ConsumerOption {
}
}

// DeliverHeadersOnlyEx configures the consumer to deliver headers only. If headersOnly is false, the consumer will deliver the full message.
func DeliverHeadersOnlyEx(headersOnly bool) ConsumerOption {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the Ex in the name?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I see now. This results in 2 ways to achieve the same.

So I think I would rather have a function something like DeliverBodies() or similar function rather than end up with 2 ways to set true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, updated. I gave you the context in our Slack instead of here.

@ramonberrutti ramonberrutti force-pushed the consumer-headers-only branch from eec1fda to e7b9d86 Compare July 1, 2024 13:10
@ramonberrutti ramonberrutti changed the title [ADD] extend DeliverHeadersOnly to allow to revert bodies [ADD] DeliverBodies to disable headersOnly Jul 1, 2024
@ramonberrutti ramonberrutti requested a review from ripienaar July 1, 2024 13:11
@ripienaar
Copy link
Collaborator

Seems you wanted to push a commit that moves to DeliverBodies() but github pr diff still shows the old names

If not already done in the new code please update the comment on HeadersOnly indicating that the new function inverts it

@ramonberrutti ramonberrutti force-pushed the consumer-headers-only branch from e7b9d86 to bd1d572 Compare July 5, 2024 08:57
@ramonberrutti
Copy link
Contributor Author

Seems you wanted to push a commit that moves to DeliverBodies() but github pr diff still shows the old names

If not already done in the new code please update the comment on HeadersOnly indicating that the new function inverts it

Thank you. I edited the commit message and did not push the changes.

Copy link
Collaborator

@ripienaar ripienaar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ripienaar ripienaar merged commit 2b7a6dc into nats-io:main Jul 5, 2024
@ripienaar
Copy link
Collaborator

Thank you!

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.

2 participants