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

Rocketmq 5: set context for async callback #7238

Merged
merged 2 commits into from
Nov 22, 2022

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Nov 18, 2022

Run callbacks added to the CompletableFuture returned from sendAsync with the context that was used when sendAsync was called.
Add test for capturing message headers.

@laurit laurit requested a review from aaron-ai November 18, 2022 17:42
@laurit laurit requested a review from a team as a code owner November 18, 2022 17:42
Comment on lines +103 to +105
if (consumer != null) {
// Not calling consumer.close(); because it takes a lot of time to complete
Copy link
Member

Choose a reason for hiding this comment

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

the built-in threadpools don't shutdown if consumer#close is not called, or could we submit an async task to close consumer here?

Comment on lines +58 to +64

transformer.applyAdviceToMethod(
isMethod()
.and(named("sendAsync"))
.and(takesArguments(1))
.and(takesArgument(0, named("org.apache.rocketmq.client.apis.message.Message"))),
ProducerImplInstrumentation.class.getName() + "$SendAsyncAdvice");
Copy link
Member

Choose a reason for hiding this comment

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

Nice catch for Producer#sendAsync👍🏻

@trask trask merged commit 910d177 into open-telemetry:main Nov 22, 2022
@laurit laurit deleted the rocketmq-async-callback branch July 6, 2023 17:37
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

4 participants