Skip to content

Add lambda-based methods to consume messages #252

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 3 commits into from
Mar 1, 2017

Conversation

acogoluegnes
Copy link
Contributor

Only basic.deliver and basic.cancel callbacks are covered.
They're likely to be the most commonly used. This can provide
a straightforward syntax when callbacks are simple (e.g. one line).
The Delivery wrapper class from RpcServer has been extracted as
a top level class: it's used in the deliver callback to avoid
having a lambda with 4 parameters.

Fixes #247

Only basic.deliver and basic.cancel callbacks are covered.
They're likely to be the most commonly used. This can provide
a straightforward syntax when callbacks are simple (e.g. one line).
The Delivery wrapper class from RpcServer has been extracted as
a top level class: it's used in the deliver callback to avoid
having a lambda with 4 parameters.

Fixes #247
*/
public byte[] getBody() {
return _body;
}
Copy link

Choose a reason for hiding this comment

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

Can equals and hashCode be defined in here to support mocking? The same question could be said for https://github.com/rabbitmq/rabbitmq-java-client/blob/master/src/main/java/com/rabbitmq/client/Return.java which was recently added.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that's a good idea but we can do it in a follow-up PR (feel free to look into a pull request ;))

Copy link

Choose a reason for hiding this comment

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

Sounds good, I'll try and put one together.

@michaelklishin michaelklishin merged commit df689cf into master Mar 1, 2017
@acogoluegnes acogoluegnes deleted the rabbitmq-java-client-247 branch March 21, 2019 08:27
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