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 example producer using DeferredConfirm #149

Merged
merged 1 commit into from Jan 18, 2023
Merged

Conversation

Zerpet
Copy link
Contributor

@Zerpet Zerpet commented Jan 3, 2023

The usage of DeferredConfirmation may not be trivial or clear to everybody.
This example demonstrates the use case to send a message and wait for its
confirmation, before moving forward. This would probably provide suboptimal
performance, but not every user cares about having a blazing fast rabbit.

@Zerpet Zerpet requested a review from lukebakken January 3, 2023 16:18
Copy link
Contributor

@lukebakken lukebakken left a comment

Choose a reason for hiding this comment

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

It's good to have a deferred confirmation example, but if we show how to do it this way, people will copy this code and wonder why publishing is slow.

We should re-work this to do it the "right" way in the same manner that we do for our "Tutorial 7" examples, then we can add Go to that.

@lukebakken lukebakken self-assigned this Jan 17, 2023
@lukebakken lukebakken self-requested a review January 17, 2023 22:25
@lukebakken
Copy link
Contributor

@Zerpet let me know what you think

Copy link
Contributor Author

@Zerpet Zerpet left a comment

Choose a reason for hiding this comment

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

One question regarding the select. Everything else looks good. I pushed a change to follow Go naming convention 👀

What do you think @lukebakken ?

_examples/producer-confirms/producer.go Outdated Show resolved Hide resolved
@lukebakken lukebakken force-pushed the example-deferredConfirm branch 3 times, most recently from 30b2e6b to e6fb345 Compare January 18, 2023 15:17
Signed-off-by: Aitor Pérez Cedres <acedres@vmware.com>

Start tracking outstanding confirms

Producer example keeps a window of outstanding confirms

Update example with name conventions

Following Go naming conventions. Change Dial function to use DialConfig
instead, since we are creating a Config struct.

Signed-off-by: Aitor Pérez Cedres <acedres@vmware.com>

Better naming, better way to check confirms when exiting confirm handler

The producer example should be one that handles confirms

Always check exit at start of confirm handler
@lukebakken lukebakken merged commit e1b77e8 into main Jan 18, 2023
@lukebakken lukebakken deleted the example-deferredConfirm branch January 18, 2023 15:28
@lukebakken lukebakken added this to the 1.6.0 milestone Jan 18, 2023
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

2 participants