Credentials management utilities shared by the RabbitMQ Java libraries (token refresh, OAuth 2 client credentials support).
This library is meant only for the RabbitMQ Java libraries (e.g. the AMQP 1.0 Java client and the stream Java client). Its API is not public and not considered stable.
This library supports Java 8+.
Main and test code must compile with --release 8: do not use Java 9+ APIs.
./mvnw clean test-compile./mvnw test-compileTests do not need any external service:
./mvnw verifyTo run a single test:
./mvnw test -Dtest=TokenCredentialsManagerTestsrc/main/java/com/rabbitmq/client/credentials: credentials manager contract and token refreshsrc/main/java/com/rabbitmq/client/credentials/oauth2: OAuth 2 supportsrc/test/java: tests
Under src/main/java/com/rabbitmq/client/credentials/:
CredentialsManager.java: contract to authenticate and re-authenticate components (e.g. connections)TokenCredentialsManager.java: credentials manager that requests and refreshes tokensoauth2/HttpTokenRequester.java: OAuth 2 token requester over HTTP(S)oauth2/GsonTokenParser.java: OAuth 2 token response parser
- Format code with
./mvnw spotless:applyat the end of each task (requires JDK 17+)
- Only add very important comments, both in tests and in the implementation
- Never add yourself to the list of commit co-authors
- Never mention yourself in commit messages in any way (no "Generated by", no AI tool links, etc)
- Never add full stops to Markdown list items
After completing a task, perform up to twenty iterative reviews of your changes. In every iteration, look for meaningful improvements that were missed, for gaps in test coverage, and for deviations from the instructions in this file.
If no meaningful improvements are found for three iterations in a row, report it and stop iterating.