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

make RpcClient implement java.io.Closeable #1033

Merged
merged 1 commit into from
May 16, 2023
Merged

Conversation

JHahnHRO
Copy link
Contributor

@JHahnHRO JHahnHRO commented May 15, 2023

Proposed Changes

Resolve Issue #1032 by making RpcClient implement java.io.Closeable. The close method was rewritten to be idempotent in accordance with the Spec of Closeable. Now RpcClient can be used in a try-with-resources block and IDEs will (hopefully) remind developers if they forget to call the close method.

Types of Changes

  • Bugfix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (correction or otherwise)
  • Cosmetics (whitespace, appearance)

Checklist

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq) @pivotal-cla This is an Obvious Fix
  • All tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in related repositories

@pivotal-cla
Copy link

@JHahnHRO 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

@JHahnHRO This Pull Request contains an obvious fix. Signing the Contributor License Agreement is not necessary.

@michaelklishin
Copy link
Member

This is an interesting interpretation of Closeable, and for RpcClient, it makes sense. @acogoluegnes any objections?

@acogoluegnes acogoluegnes merged commit 478979b into rabbitmq:main May 16, 2023
@acogoluegnes
Copy link
Contributor

LGTM. Thanks!

acogoluegnes added a commit that referenced this pull request May 16, 2023
Instead of using the consumer property. Avoids race conditions
during closing.

References #1033
acogoluegnes added a commit that referenced this pull request May 16, 2023
Instead of using the consumer property. Avoids race conditions
during closing.

References #1033

(cherry picked from commit 2253017)
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.

4 participants