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

Match replies to request in nats sub #542

Merged
merged 2 commits into from
Aug 15, 2022

Conversation

Haramaty
Copy link
Contributor

This adds a --match-replies flag to nats sub which matches replies to any request sent to the subscribed subject.

The feature is implemented using an additional subscription on _INBOX.> subject, and a map matching reply subjects to requests.

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.

Nice idea I like it but probably it will be for the next CLI release so I will land a few PRs today and then we rebase and review this one thoroughly for the next release.

The print logic has been a area of many bugs so I want to be quite careful when toushing this

Sorry for the delay here I was out for a few weeks

@Haramaty Haramaty force-pushed the feature/match-replies branch from 02be17a to 834a94d Compare August 7, 2022 08:33
@Haramaty
Copy link
Contributor Author

Haramaty commented Aug 7, 2022

Hi, thank you for the PR 😊
Notice I also rebased on top of current main.

Sorry about all the name conventions, I haven't written Go in some years. Let me know when you're reviewing this again, or if you need me to rebase again 👍🏼

@ripienaar
Copy link
Collaborator

nice, thanks for the update, I will test it during the week carefully and let you know! nice idea thank you

Haramaty and others added 2 commits August 8, 2022 14:23
When `--match-replies` flag is given, requests are matched with their
respective replies, and printed/dumped together (respecting
`--dump`/`--raw` flags).

This is implemented by listening to all subjects under `_INBOX`, and
matching them with requests using a map.

Co-authored-by: Margarita Tronik <mtronik1@gmail.com>
@Haramaty Haramaty force-pushed the feature/match-replies branch from 834a94d to 3451ca0 Compare August 8, 2022 11:23
@Haramaty
Copy link
Contributor Author

Haramaty commented Aug 8, 2022

I forgot to run go fmt and failed the lint check, sorry 😬
Fixed now

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.

This is great, just a small question about behavior otherwise i think its mergable

@Haramaty Haramaty requested a review from ripienaar August 14, 2022 09:08
@ripienaar ripienaar merged commit 9a2b381 into nats-io:main Aug 15, 2022
@ripienaar
Copy link
Collaborator

Thanks for the contribution!

@Haramaty Haramaty deleted the feature/match-replies branch August 15, 2022 11:00
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.

None yet

3 participants