Skip to content

Documentation: fixup example for sending a message #1874

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

Merged
merged 1 commit into from
Jul 19, 2021
Merged

Documentation: fixup example for sending a message #1874

merged 1 commit into from
Jul 19, 2021

Conversation

ttrei
Copy link
Contributor

@ttrei ttrei commented Jul 19, 2021

No description provided.

@pivotal-cla
Copy link

@ttrei Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@ttrei Thank you for signing the Contributor License Agreement!

@garyrussell
Copy link
Contributor

This is invalid; the success method gets a SendResult. Why do you believe it should be changed?

future.addCallback(new ListenableFutureCallback<SendResult<Integer, String>>() {
@Override
public void onSuccess(SendResult<Integer, String> result) {
theResult.set(result);
latch.countDown();
}
@Override
public void onFailure(Throwable ex) {
}
});

@ttrei
Copy link
Contributor Author

ttrei commented Jul 19, 2021

Because otherwise the code doesn't compile :)

Here is an example from the same test file:

future.addCallback(new KafkaSendCallback<Integer, String>() {
@Override
public void onSuccess(SendResult<Integer, String> result) {
}

@garyrussell
Copy link
Contributor

Oops; yes; sorry about that; the first test doesn't use the specialized callback.

@garyrussell
Copy link
Contributor

Thanks.

@garyrussell garyrussell merged commit 3fb3bb8 into spring-projects:main Jul 19, 2021
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.

3 participants