-
Notifications
You must be signed in to change notification settings - Fork 672
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
Adding a function to wait for publisher confirms #841
Adding a function to wait for publisher confirms #841
Conversation
manchicken
commented
Jul 24, 2024
- Also added an example program to demo it
- Also removed a deprecated uninit function call from the ssl example
- Also added an example program to demo it - Also removed a deprecated uninit function call from the ssl example
Correcting unused lvalue error.
Fixing more unused params issues
Correcting format.
I'm working on adding publisher confirms to the The example isn't the most imaginative, I know, but it shows how to use the new function. |
bd822a8
to
5fbeae2
Compare
Apologies for all of the confusion and CI runs, I don't have a Windows test environment. I think I got all CI passing now. |
Approach LGTM. Will do a pass on the actual implementation shortly. |
Thanks! My C is a bit rusty, so feel free to point out anything I could improve there as well. |
include/rabbitmq-c/amqp.h
Outdated
*/ | ||
AMQP_EXPORT | ||
amqp_rpc_reply_t AMQP_CALL amqp_publisher_confirm_wait( | ||
amqp_connection_state_t state, amqp_envelope_t *envelope, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you describe the intended purpose of the envelope parameter?
Seems like this may not be required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's the only thing that'll tell you which channel the ACK came through. The code for the amqp_basic_ack_t
is correct per spec, naturally, but it can be helpful to know which channel the ACK came on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you have any more questions or requests for change on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If all you need is the channel id, then use amqp_channel_t*
as an output parameter.
Alternatively consider using an amqp_channel_t
as an input parameter, then only wait for the confirm on this channel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the pulling the channel as an output parameter, and I'll combine that change with the method out param as well. I think making it filter by channel ID may be outside the scope of what I'm doing here, and the channel out param will allow the caller to easily implement that if they want to.
- Removing extra empty line - Changing order of params so `in`s come before `out`s.
@alanxz Let me know if there's anything else you'd like to see changed here. I'd really like to get this into my Perl module, users have been asking for it for a long time. |
@alanxz any updates? |
Apologies for the delay, life has been a bit busy lately. |
Don't I know it, friend. Good luck and solidarity. |
@alanxz I looked at this a bit more and left some notes. Please let me know what you think. Also, is there any way we could label this PR |
- Added a typedef for publisher confirm responses - Simplified `amqp_publisher_confirm_wait()` to only have a single out parameter which contains everything the caller would want - Now `amqp_publisher_confirm_wait()` handles `basic.ack`, `basic.nack`, and `basic.reject`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks much better.
I'll fix the fuzzer Check later this week, please resolve remaining small issues and I'll merge this.
librabbitmq/amqp_api.c
Outdated
break; | ||
|
||
default: | ||
fprintf(stderr, "Got 0x%X for the method, which is «%s».\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The library shouldn't print anything to stderr/stdout.
Please remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack! Debug code. Sorry, that's what I get for pushing changes after bedtime. I'll get that.
#843 should fix the CIFuzz check issue |
I've updated my branch. I'm gonna try to make the requested changes now. Do you think you could add the |
- Removed debug code (oops!) - Added documentation
@alanxz Any updates? I'd like to see if I can get things moving along soon so I can start my work on the Perl side of what I'm doing with this. |
Removing sleep and unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor things, otherwise this is good to go, thanks for your patience.
Removing debug code
Updated code doc for accuracy
Updated; thanks. |
🥳 |
@alanxz Do you know when this will be released? Not trying to rush you, just trying to time things better. |
@manchicken I'll try and roll a release in the next few weeks. |
Thanks!~ Mike StemleOn Oct 25, 2024, at 08:46, Alan Antonuk ***@***.***> wrote:
@manchicken I'll try and roll a release in the next few weeks.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I've released v0.15.0 |