├── .git-blame-ignore-revs ├── .github ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml └── workflows │ ├── codeql-analysis.yml │ ├── publish-snapshot.yml │ ├── release.yml │ ├── test-native-image.yml │ ├── test-rabbitmq-alphas.yml │ ├── test-supported-java-versions-5.x.yml │ ├── test-supported-java-versions-main.yml │ └── test.yml ├── .gitignore ├── .mvn ├── maven.config └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── LICENSE-APACHE2 ├── LICENSE-GPL2 ├── LICENSE-MPL-RabbitMQ ├── Makefile ├── README.adoc ├── RUNNING_TESTS.md ├── ci ├── _start-cluster.sh ├── cluster │ ├── configuration │ │ └── rabbitmq.conf │ └── docker-compose.yml ├── release-java-client.sh ├── start-broker.sh └── start-cluster.sh ├── codegen.py ├── deploy-javadoc.sh ├── doc └── channels │ ├── channels.pdf │ ├── channels.tex │ ├── whiteboard.JPG │ ├── worktransition.graffle │ ├── worktransition.pdf │ └── zed-cm.sty ├── generate-observation-documentation.sh ├── mvnw ├── mvnw.cmd ├── pom.xml ├── release-versions.txt └── src ├── main ├── java │ └── com │ │ └── rabbitmq │ │ ├── client │ │ ├── Address.java │ │ ├── AddressResolver.java │ │ ├── AlreadyClosedException.java │ │ ├── AuthenticationFailureException.java │ │ ├── BasicProperties.java │ │ ├── BlockedCallback.java │ │ ├── BlockedListener.java │ │ ├── BuiltinExchangeType.java │ │ ├── CancelCallback.java │ │ ├── Channel.java │ │ ├── ChannelContinuationTimeoutException.java │ │ ├── Command.java │ │ ├── ConfirmCallback.java │ │ ├── ConfirmListener.java │ │ ├── Connection.java │ │ ├── ConnectionFactory.java │ │ ├── ConnectionFactoryConfigurator.java │ │ ├── Consumer.java │ │ ├── ConsumerCancelledException.java │ │ ├── ConsumerShutdownSignalCallback.java │ │ ├── ContentHeader.java │ │ ├── DefaultConsumer.java │ │ ├── DefaultSaslConfig.java │ │ ├── DefaultSocketChannelConfigurator.java │ │ ├── DefaultSocketConfigurator.java │ │ ├── DeliverCallback.java │ │ ├── Delivery.java │ │ ├── DnsRecordIpAddressResolver.java │ │ ├── DnsSrvRecordAddressResolver.java │ │ ├── Envelope.java │ │ ├── ExceptionHandler.java │ │ ├── GetResponse.java │ │ ├── JDKSaslConfig.java │ │ ├── ListAddressResolver.java │ │ ├── LongString.java │ │ ├── MalformedFrameException.java │ │ ├── MapRpcServer.java │ │ ├── MessageProperties.java │ │ ├── Method.java │ │ ├── MetricsCollector.java │ │ ├── MissedHeartbeatException.java │ │ ├── NoOpMetricsCollector.java │ │ ├── PossibleAuthenticationFailureException.java │ │ ├── ProtocolVersionMismatchException.java │ │ ├── Recoverable.java │ │ ├── RecoverableChannel.java │ │ ├── RecoverableConnection.java │ │ ├── RecoveryDelayHandler.java │ │ ├── RecoveryListener.java │ │ ├── ResolvedInetAddress.java │ │ ├── Return.java │ │ ├── ReturnCallback.java │ │ ├── ReturnListener.java │ │ ├── RpcClient.java │ │ ├── RpcClientParams.java │ │ ├── RpcServer.java │ │ ├── SaslConfig.java │ │ ├── SaslMechanism.java │ │ ├── ShutdownListener.java │ │ ├── ShutdownNotifier.java │ │ ├── ShutdownSignalException.java │ │ ├── SocketChannelConfigurator.java │ │ ├── SocketChannelConfigurators.java │ │ ├── SocketConfigurator.java │ │ ├── SocketConfigurators.java │ │ ├── SslContextFactory.java │ │ ├── SslEngineConfigurator.java │ │ ├── SslEngineConfigurators.java │ │ ├── StringRpcServer.java │ │ ├── TopologyRecoveryException.java │ │ ├── TrafficListener.java │ │ ├── TrustEverythingTrustManager.java │ │ ├── UnblockedCallback.java │ │ ├── UnexpectedFrameError.java │ │ ├── UnexpectedMethodError.java │ │ ├── UnknownClassOrMethodId.java │ │ ├── UnroutableRpcRequestException.java │ │ ├── impl │ │ │ ├── AMQBasicProperties.java │ │ │ ├── AMQChannel.java │ │ │ ├── AMQCommand.java │ │ │ ├── AMQConnection.java │ │ │ ├── AMQContentHeader.java │ │ │ ├── AbstractFrameHandlerFactory.java │ │ │ ├── AbstractMetricsCollector.java │ │ │ ├── AnonymousMechanism.java │ │ │ ├── CRDemoMechanism.java │ │ │ ├── ChannelManager.java │ │ │ ├── ChannelN.java │ │ │ ├── ClientVersion.java │ │ │ ├── CommandAssembler.java │ │ │ ├── CompletableFutureRpcWrapper.java │ │ │ ├── ConnectionParams.java │ │ │ ├── ConsumerDispatcher.java │ │ │ ├── ConsumerWorkService.java │ │ │ ├── ContentHeaderPropertyReader.java │ │ │ ├── ContentHeaderPropertyWriter.java │ │ │ ├── CredentialsProvider.java │ │ │ ├── CredentialsRefreshService.java │ │ │ ├── DefaultCredentialsProvider.java │ │ │ ├── DefaultCredentialsRefreshService.java │ │ │ ├── DefaultExceptionHandler.java │ │ │ ├── Environment.java │ │ │ ├── ErrorOnWriteListener.java │ │ │ ├── ExternalMechanism.java │ │ │ ├── ForgivingExceptionHandler.java │ │ │ ├── Frame.java │ │ │ ├── FrameHandler.java │ │ │ ├── FrameHandlerFactory.java │ │ │ ├── HeartbeatSender.java │ │ │ ├── LogTrafficListener.java │ │ │ ├── LongStringHelper.java │ │ │ ├── Method.java │ │ │ ├── MethodArgumentReader.java │ │ │ ├── MethodArgumentWriter.java │ │ │ ├── MicrometerMetricsCollector.java │ │ │ ├── NetworkConnection.java │ │ │ ├── OAuth2ClientCredentialsGrantCredentialsProvider.java │ │ │ ├── OAuthTokenManagementException.java │ │ │ ├── OpenTelemetryMetricsCollector.java │ │ │ ├── PlainMechanism.java │ │ │ ├── RefreshProtectedCredentialsProvider.java │ │ │ ├── RpcContinuationRpcWrapper.java │ │ │ ├── RpcWrapper.java │ │ │ ├── SetQueue.java │ │ │ ├── ShutdownNotifierComponent.java │ │ │ ├── SocketFrameHandler.java │ │ │ ├── SocketFrameHandlerFactory.java │ │ │ ├── StandardMetricsCollector.java │ │ │ ├── StrictExceptionHandler.java │ │ │ ├── TlsUtils.java │ │ │ ├── TruncatedInputStream.java │ │ │ ├── UnknownChannelException.java │ │ │ ├── UpdateSecretExtension.java │ │ │ ├── Utils.java │ │ │ ├── ValueReader.java │ │ │ ├── ValueWriter.java │ │ │ ├── VariableLinkedBlockingQueue.java │ │ │ ├── Version.java │ │ │ ├── WorkPool.java │ │ │ ├── WorkPoolFullException.java │ │ │ ├── nio │ │ │ │ ├── BlockingQueueNioQueue.java │ │ │ │ ├── ByteBufferFactory.java │ │ │ │ ├── ByteBufferOutputStream.java │ │ │ │ ├── DefaultByteBufferFactory.java │ │ │ │ ├── FrameBuilder.java │ │ │ │ ├── FrameWriteRequest.java │ │ │ │ ├── HeaderWriteRequest.java │ │ │ │ ├── NioContext.java │ │ │ │ ├── NioHelper.java │ │ │ │ ├── NioLoop.java │ │ │ │ ├── NioLoopContext.java │ │ │ │ ├── NioParams.java │ │ │ │ ├── NioQueue.java │ │ │ │ ├── SelectorHolder.java │ │ │ │ ├── SocketChannelFrameHandler.java │ │ │ │ ├── SocketChannelFrameHandlerFactory.java │ │ │ │ ├── SocketChannelFrameHandlerState.java │ │ │ │ ├── SocketChannelRegistration.java │ │ │ │ ├── SslEngineByteBufferOutputStream.java │ │ │ │ ├── SslEngineFrameBuilder.java │ │ │ │ ├── SslEngineHelper.java │ │ │ │ ├── WriteRequest.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ └── recovery │ │ │ │ ├── AutorecoveringChannel.java │ │ │ │ ├── AutorecoveringConnection.java │ │ │ │ ├── BackoffPolicy.java │ │ │ │ ├── ConsumerRecoveryListener.java │ │ │ │ ├── DefaultRetryHandler.java │ │ │ │ ├── QueueRecoveryListener.java │ │ │ │ ├── RecordedBinding.java │ │ │ │ ├── RecordedConsumer.java │ │ │ │ ├── RecordedEntity.java │ │ │ │ ├── RecordedExchange.java │ │ │ │ ├── RecordedExchangeBinding.java │ │ │ │ ├── RecordedNamedEntity.java │ │ │ │ ├── RecordedQueue.java │ │ │ │ ├── RecordedQueueBinding.java │ │ │ │ ├── RecoveredQueueNameSupplier.java │ │ │ │ ├── RecoveryAwareAMQConnection.java │ │ │ │ ├── RecoveryAwareAMQConnectionFactory.java │ │ │ │ ├── RecoveryAwareChannelManager.java │ │ │ │ ├── RecoveryAwareChannelN.java │ │ │ │ ├── RecoveryCanBeginListener.java │ │ │ │ ├── RetryContext.java │ │ │ │ ├── RetryHandler.java │ │ │ │ ├── RetryResult.java │ │ │ │ ├── TopologyRecoveryFilter.java │ │ │ │ ├── TopologyRecoveryRetryHandlerBuilder.java │ │ │ │ ├── TopologyRecoveryRetryLogic.java │ │ │ │ ├── Utils.java │ │ │ │ └── package-info.java │ │ ├── observation │ │ │ ├── NoOpObservationCollector.java │ │ │ ├── ObservationCollector.java │ │ │ └── micrometer │ │ │ │ ├── DefaultDeliverObservationConvention.java │ │ │ │ ├── DefaultProcessObservationConvention.java │ │ │ │ ├── DefaultPublishObservationConvention.java │ │ │ │ ├── DefaultReceiveObservationConvention.java │ │ │ │ ├── DeliverContext.java │ │ │ │ ├── DeliverObservationConvention.java │ │ │ │ ├── MicrometerObservationCollector.java │ │ │ │ ├── MicrometerObservationCollectorBuilder.java │ │ │ │ ├── PublishContext.java │ │ │ │ ├── PublishObservationConvention.java │ │ │ │ └── RabbitMqObservationDocumentation.java │ │ └── package-info.java │ │ ├── tools │ │ ├── json │ │ │ ├── JSONUtil.java │ │ │ └── package-info.java │ │ ├── jsonrpc │ │ │ ├── JacksonJsonRpcMapper.java │ │ │ ├── JsonRpcClient.java │ │ │ ├── JsonRpcException.java │ │ │ ├── JsonRpcMapper.java │ │ │ ├── JsonRpcMappingException.java │ │ │ ├── JsonRpcServer.java │ │ │ ├── ParameterDescription.java │ │ │ ├── ProcedureDescription.java │ │ │ ├── ServiceDescription.java │ │ │ └── package-info.java │ │ └── package-info.java │ │ └── utility │ │ ├── BlockingCell.java │ │ ├── BlockingValueOrException.java │ │ ├── IntAllocator.java │ │ ├── SensibleClone.java │ │ ├── Utility.java │ │ ├── ValueOrException.java │ │ └── package-info.java ├── resources │ ├── META-INF │ │ └── native-image │ │ │ └── com.rabbitmq │ │ │ └── amqp-client │ │ │ └── native-image.properties │ ├── rabbitmq-amqp-client.properties │ └── version.properties └── scripts │ └── generate_amqp_sources.groovy └── test ├── java ├── SanityCheck.java └── com │ └── rabbitmq │ ├── client │ ├── AbstractJsonRpcTest.java │ ├── AmqpClientTestExtension.java │ ├── JacksonJsonRpcTest.java │ ├── QueueingConsumer.java │ ├── impl │ │ ├── AMQConnectionRefreshCredentialsTest.java │ │ ├── DefaultCredentialsRefreshServiceTest.java │ │ ├── OAuth2ClientCredentialsGrantCredentialsProviderTest.java │ │ ├── RefreshProtectedCredentialsProviderTest.java │ │ ├── ValueWriterTest.java │ │ ├── WorkPoolTests.java │ │ └── recovery │ │ │ └── AutorecoveringChannelTest.java │ └── test │ │ ├── AMQBuilderApiTest.java │ │ ├── AMQChannelTest.java │ │ ├── AMQConnectionTest.java │ │ ├── AddressTest.java │ │ ├── AmqpUriTest.java │ │ ├── BlockedConnectionTest.java │ │ ├── BlockingCellTest.java │ │ ├── BrokenFramesTest.java │ │ ├── BrokerTestCase.java │ │ ├── Bug20004Test.java │ │ ├── ChannelAsyncCompletableFutureTest.java │ │ ├── ChannelNTest.java │ │ ├── ChannelNumberAllocationTests.java │ │ ├── ChannelRpcTimeoutIntegrationTest.java │ │ ├── ClientTestSuite.java │ │ ├── ClientVersionTest.java │ │ ├── ClonePropertiesTest.java │ │ ├── CloseInMainLoop.java │ │ ├── ConfirmBase.java │ │ ├── ConnectionFactoryTest.java │ │ ├── ConnectionTest.java │ │ ├── DefaultRetryHandlerTest.java │ │ ├── DnsRecordIpAddressResolverTests.java │ │ ├── DnsSrvRecordAddressResolverTest.java │ │ ├── FrameBuilderTest.java │ │ ├── FrameTest.java │ │ ├── GeneratedClassesTest.java │ │ ├── JavaNioTest.java │ │ ├── LambdaCallbackTest.java │ │ ├── LongStringTest.java │ │ ├── MaxInboundMessageSizeTest.java │ │ ├── MetricsCollectorTest.java │ │ ├── MicrometerMetricsCollectorTest.java │ │ ├── MultiThreadedChannel.java │ │ ├── NioDeadlockOnConnectionClosing.java │ │ ├── NoAutoRecoveryWhenTcpWindowIsFullTest.java │ │ ├── PropertyFileInitialisationTest.java │ │ ├── QueueingConsumerTests.java │ │ ├── RecoveryAwareAMQConnectionFactoryTest.java │ │ ├── RecoveryDelayHandlerTest.java │ │ ├── RefreshCredentialsTest.java │ │ ├── RequiredPropertiesSuite.java │ │ ├── RpcTest.java │ │ ├── RpcTopologyRecordingTest.java │ │ ├── SharedThreadPoolTest.java │ │ ├── SslContextFactoryTest.java │ │ ├── StrictExceptionHandlerTest.java │ │ ├── TableTest.java │ │ ├── TestUtils.java │ │ ├── TestUtilsTest.java │ │ ├── TlsUtilsTest.java │ │ ├── TrafficListenerTest.java │ │ ├── TruncatedInputStreamTest.java │ │ ├── ValueOrExceptionTest.java │ │ ├── functional │ │ ├── AbstractRejectTest.java │ │ ├── AlternateExchange.java │ │ ├── BasicConsume.java │ │ ├── BasicGet.java │ │ ├── BindingLifecycle.java │ │ ├── BindingLifecycleBase.java │ │ ├── CcRoutes.java │ │ ├── ClusteredTestBase.java │ │ ├── Confirm.java │ │ ├── ConnectionOpen.java │ │ ├── ConnectionRecovery.java │ │ ├── ConsumerCancelNotification.java │ │ ├── ConsumerCount.java │ │ ├── ConsumerPriorities.java │ │ ├── DeadLetterExchange.java │ │ ├── DefaultExchange.java │ │ ├── DirectReplyTo.java │ │ ├── DoubleDeletion.java │ │ ├── DurableOnTransient.java │ │ ├── ExceptionHandling.java │ │ ├── ExceptionMessages.java │ │ ├── ExchangeDeclare.java │ │ ├── ExchangeDeleteIfUnused.java │ │ ├── ExchangeDeletePredeclared.java │ │ ├── ExchangeEquivalenceBase.java │ │ ├── ExchangeExchangeBindings.java │ │ ├── ExchangeExchangeBindingsAutoDelete.java │ │ ├── FrameMax.java │ │ ├── FunctionalTestSuite.java │ │ ├── HeadersExchangeValidation.java │ │ ├── Heartbeat.java │ │ ├── InternalExchange.java │ │ ├── InvalidAcks.java │ │ ├── InvalidAcksBase.java │ │ ├── InvalidAcksTx.java │ │ ├── MessageCount.java │ │ ├── Metrics.java │ │ ├── MicrometerObservationCollectorMetrics.java │ │ ├── Nack.java │ │ ├── NoRequeueOnCancel.java │ │ ├── Nowait.java │ │ ├── PerConsumerPrefetch.java │ │ ├── PerMessageTTL.java │ │ ├── PerQueueTTL.java │ │ ├── PerQueueVsPerMessageTTL.java │ │ ├── Policies.java │ │ ├── QosTests.java │ │ ├── QueueExclusivity.java │ │ ├── QueueLease.java │ │ ├── QueueLifecycle.java │ │ ├── QueueSizeLimit.java │ │ ├── Recover.java │ │ ├── Reject.java │ │ ├── RequeueOnChannelClose.java │ │ ├── RequeueOnClose.java │ │ ├── RequeueOnConnectionClose.java │ │ ├── Routing.java │ │ ├── SaslMechanisms.java │ │ ├── TTLHandling.java │ │ ├── Tables.java │ │ ├── TopologyRecoveryFiltering.java │ │ ├── TopologyRecoveryRetry.java │ │ ├── Transactions.java │ │ ├── UnbindAutoDeleteExchange.java │ │ ├── UnexpectedFrames.java │ │ └── UserIDHeader.java │ │ ├── server │ │ ├── AlternateExchangeEquivalence.java │ │ ├── BlockedConnection.java │ │ ├── Bug19219Test.java │ │ ├── ChannelLimitNegotiation.java │ │ ├── DeadLetterExchangeDurable.java │ │ ├── DurableBindingLifecycle.java │ │ ├── EffectVisibilityCrossNodeTest.java │ │ ├── ExclusiveQueueDurability.java │ │ ├── Firehose.java │ │ ├── HaTestSuite.java │ │ ├── LastHaTestSuite.java │ │ ├── LoopbackUsers.java │ │ ├── MemoryAlarms.java │ │ ├── MessageRecovery.java │ │ ├── Permissions.java │ │ ├── PersistenceGuarantees.java │ │ ├── PriorityQueues.java │ │ ├── ServerTestSuite.java │ │ ├── Shutdown.java │ │ ├── TopicPermissions.java │ │ └── XDeathHeaderGrowth.java │ │ └── ssl │ │ ├── BadVerifiedConnection.java │ │ ├── ConnectionFactoryDefaultTlsVersion.java │ │ ├── HostnameVerification.java │ │ ├── NioTlsUnverifiedConnection.java │ │ ├── SslTestSuite.java │ │ ├── TlsConnectionLogging.java │ │ ├── TlsTestUtils.java │ │ ├── UnverifiedConnection.java │ │ └── VerifiedConnection.java │ ├── tools │ └── Host.java │ └── utility │ └── IntAllocatorTests.java └── resources ├── META-INF └── services │ └── org.junit.jupiter.api.extension.Extension ├── junit-platform.properties ├── logback-test.xml └── property-file-initialisation ├── configuration.properties └── tls ├── keystore.p12 └── truststore.jks /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # Bump (c) year to 2025 2 | 24d78382a0c195904f054413f208e9e1aa92bc11 3 | be27b603f804d24a293013298b84307227f263b6 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for using RabbitMQ and for taking the time to report an 2 | issue. 3 | 4 | ## Does This Belong to GitHub or RabbitMQ Mailing List? 5 | 6 | *Important:* please first read the `CONTRIBUTING.md` document in the 7 | root of this repository. It will help you determine whether your 8 | feedback should be directed to the RabbitMQ mailing list [1] instead. 9 | 10 | ## Please Help Maintainers and Contributors Help You 11 | 12 | In order for the RabbitMQ team to investigate your issue, please provide 13 | **as much as possible** of the following details: 14 | 15 | * RabbitMQ version 16 | * Erlang version 17 | * RabbitMQ server and client application log files 18 | * A runnable code sample, terminal transcript or detailed set of 19 | instructions that can be used to reproduce the issue 20 | * RabbitMQ plugin information via `rabbitmq-plugins list` 21 | * Client library version (for all libraries used) 22 | * Operating system, version, and patch level 23 | 24 | Running the `rabbitmq-collect-env` [2] script can provide most of the 25 | information needed. Please make the archive available via a third-party 26 | service and note that **the script does not attempt to scrub any 27 | sensitive data**. 28 | 29 | If your issue involves RabbitMQ management UI or HTTP API, please also provide 30 | the following: 31 | 32 | * Browser and its version 33 | * What management UI page was used (if applicable) 34 | * How the HTTP API requests performed can be reproduced with `curl` 35 | * Operating system on which you are running your browser, and its version 36 | * Errors reported in the JavaScript console (if any) 37 | 38 | This information **greatly speeds up issue investigation** (or makes it 39 | possible to investigate it at all). Please help project maintainers and 40 | contributors to help you by providing it! 41 | 42 | 1. https://groups.google.com/forum/#!forum/rabbitmq-users 43 | 2. https://github.com/rabbitmq/support-tools/blob/master/scripts/rabbitmq-collect-env 44 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Proposed Changes 2 | 3 | Please describe the big picture of your changes here to communicate to the 4 | RabbitMQ team why we should accept this pull request. If it fixes a bug or 5 | resolves a feature request, be sure to link to that issue. 6 | 7 | A pull request that doesn't explain **why** the change was made has a much 8 | lower chance of being accepted. 9 | 10 | If English isn't your first language, don't worry about it and try to 11 | communicate the problem you are trying to solve to the best of your abilities. 12 | As long as we can understand the intent, it's all good. 13 | 14 | ## Types of Changes 15 | 16 | What types of changes does your code introduce to this project? 17 | _Put an `x` in the boxes that apply_ 18 | 19 | - [ ] Bugfix (non-breaking change which fixes issue #NNNN) 20 | - [ ] New feature (non-breaking change which adds functionality) 21 | - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) 22 | - [ ] Documentation (correction or otherwise) 23 | - [ ] Cosmetics (whitespace, appearance) 24 | 25 | ## Checklist 26 | 27 | _Put an `x` in the boxes that apply. You can also fill these out after creating 28 | the PR. If you're unsure about any of them, don't hesitate to ask on the 29 | mailing list. We're here to help! This is simply a reminder of what we are 30 | going to look for before merging your code._ 31 | 32 | - [ ] I have read the `CONTRIBUTING.md` document 33 | - [ ] I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq) 34 | - [ ] All tests pass locally with my changes 35 | - [ ] I have added tests that prove my fix is effective or that my feature works 36 | - [ ] I have added necessary documentation (if appropriate) 37 | - [ ] Any dependent changes have been merged and published in related repositories 38 | 39 | ## Further Comments 40 | 41 | If this is a relatively large or complex change, kick off the discussion by 42 | explaining why you chose the solution you did and what alternatives you 43 | considered, etc. 44 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Please see the documentation for all configuration options: 2 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 3 | version: 2 4 | updates: 5 | - package-ecosystem: "maven" 6 | directory: "/" 7 | schedule: 8 | interval: "daily" 9 | open-pull-requests-limit: 20 10 | target-branch: "main" 11 | ignore: 12 | - dependency-name: "org.eclipse.jetty:jetty-servlet" 13 | versions: [ "[10.0,)" ] 14 | - dependency-name: "org.slf4j:slf4j-api" 15 | versions: [ "[2.0,)" ] 16 | - dependency-name: "ch.qos.logback:logback-classic" 17 | versions: [ "[1.3,)" ] 18 | - dependency-name: "org.apache.felix:maven-bundle-plugin" 19 | versions: [ "[6.0,)" ] 20 | - package-ecosystem: "maven" 21 | directory: "/" 22 | schedule: 23 | interval: "daily" 24 | open-pull-requests-limit: 20 25 | target-branch: "5.x.x-stable" 26 | ignore: 27 | - dependency-name: "org.eclipse.jetty:jetty-servlet" 28 | versions: ["[10.0,)"] 29 | - dependency-name: "org.slf4j:slf4j-api" 30 | versions: [ "[2.0,)" ] 31 | - dependency-name: "ch.qos.logback:logback-classic" 32 | versions: [ "[1.3,)" ] 33 | - dependency-name: "org.apache.felix:maven-bundle-plugin" 34 | versions: [ "[6.0,)" ] 35 | - package-ecosystem: "github-actions" 36 | directory: "/" 37 | schedule: 38 | interval: "daily" 39 | target-branch: "main" 40 | - package-ecosystem: "github-actions" 41 | directory: "/" 42 | schedule: 43 | interval: "daily" 44 | target-branch: "5.x.x-stable" 45 | -------------------------------------------------------------------------------- /.github/workflows/publish-snapshot.yml: -------------------------------------------------------------------------------- 1 | name: Publish snapshot 2 | 3 | on: workflow_dispatch 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-24.04 8 | 9 | steps: 10 | - uses: actions/checkout@v4 11 | - name: Set up Python 12 | uses: actions/setup-python@v5 13 | with: 14 | python-version: '3.x' 15 | - name: Set up JDK 16 | uses: actions/setup-java@v4 17 | with: 18 | distribution: 'zulu' 19 | java-version: '21' 20 | cache: 'maven' 21 | server-id: central 22 | server-username: MAVEN_USERNAME 23 | server-password: MAVEN_PASSWORD 24 | gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} 25 | gpg-passphrase: MAVEN_GPG_PASSPHRASE 26 | - name: Get dependencies 27 | run: make deps 28 | - name: Publish snapshot 29 | run: ./mvnw clean deploy -Psnapshots -DskipITs -DskipTests --no-transfer-progress 30 | env: 31 | MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }} 32 | MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN }} 33 | MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} 34 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release AMQP Java Client 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | build: 8 | runs-on: ubuntu-24.04 9 | 10 | steps: 11 | - uses: actions/checkout@v4 12 | - name: Set up Python 13 | uses: actions/setup-python@v5 14 | with: 15 | python-version: '3.x' 16 | - name: Set up JDK 17 | uses: actions/setup-java@v4 18 | with: 19 | distribution: 'temurin' 20 | java-version: '8' 21 | cache: 'maven' 22 | server-id: central 23 | server-username: MAVEN_USERNAME 24 | server-password: MAVEN_PASSWORD 25 | gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} 26 | gpg-passphrase: MAVEN_GPG_PASSPHRASE 27 | - name: Get dependencies 28 | run: make deps 29 | - name: Release AMQP Java Client 30 | run: | 31 | git config user.name "rabbitmq-ci" 32 | git config user.email "rabbitmq-ci@users.noreply.github.com" 33 | ci/release-java-client.sh 34 | env: 35 | MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }} 36 | MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN }} 37 | MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | .sw? 3 | .*.sw? 4 | *.beam 5 | *.class 6 | *.dat 7 | *.dump 8 | *.iml 9 | *.ipr 10 | *.iws 11 | .DS_Store 12 | \#~ 13 | /.idea/ 14 | /deps/ 15 | /target/ 16 | /.classpath 17 | /.project 18 | /.settings 19 | -------------------------------------------------------------------------------- /.mvn/maven.config: -------------------------------------------------------------------------------- 1 | -Dmaven.wagon.http.retryHandler.count=10 2 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rabbitmq/rabbitmq-java-client/0f47be41d8081bd779d0909753a4f4d7de166cee/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip 18 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This package, the RabbitMQ Java client library, is triple-licensed under 2 | the Mozilla Public License 2.0 ("MPL"), the GNU General Public License 3 | version 2 ("GPL") and the Apache License version 2 ("ASL"). For the MPL, 4 | please see LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 5 | For the ASL, please see LICENSE-APACHE2. 6 | 7 | This means that you may choose one of these licenses when including or 8 | using this software in your own. 9 | 10 | The RabbitMQ Java client library includes third-party software under the 11 | ASL. For this license, please see LICENSE-APACHE2. For attribution of 12 | copyright and other details of provenance, please refer to the source code. 13 | 14 | If you have any questions regarding licensing, please contact us at 15 | info@rabbitmq.com. 16 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | MVN ?= mvn 2 | MVN_FLAGS ?= 3 | 4 | ifndef DEPS_DIR 5 | ifneq ($(wildcard ../../UMBRELLA.md),) 6 | DEPS_DIR = .. 7 | else 8 | DEPS_DIR = deps 9 | endif 10 | endif 11 | 12 | MVN_FLAGS += -Ddeps.dir="$(abspath $(DEPS_DIR))" 13 | 14 | .PHONY: all deps tests clean distclean 15 | 16 | all: deps 17 | $(MVN) $(MVN_FLAGS) compile 18 | 19 | deps: $(DEPS_DIR)/rabbitmq_codegen 20 | @: 21 | 22 | dist: clean 23 | $(MVN) $(MVN_FLAGS) -DskipTests=true -Dmaven.javadoc.failOnError=false package javadoc:javadoc 24 | 25 | $(DEPS_DIR)/rabbitmq_codegen: 26 | git clone -n --depth=1 --filter=tree:0 https://github.com/rabbitmq/rabbitmq-server.git $(DEPS_DIR)/rabbitmq-server 27 | git -C $(DEPS_DIR)/rabbitmq-server sparse-checkout set --no-cone deps/rabbitmq_codegen 28 | git -C $(DEPS_DIR)/rabbitmq-server checkout 29 | cp -R $(DEPS_DIR)/rabbitmq-server/deps/rabbitmq_codegen "$@" 30 | rm -rf $(DEPS_DIR)/rabbitmq-server 31 | 32 | tests: deps 33 | $(MVN) $(MVN_FLAGS) verify 34 | 35 | deploy: 36 | $(MVN) $(MVN_FLAGS) deploy 37 | 38 | clean: 39 | $(MVN) $(MVN_FLAGS) clean 40 | 41 | distclean: clean 42 | $(MAKE) -C $(DEPS_DIR)/rabbitmq_codegen clean 43 | 44 | .PHONY: cluster-other-node 45 | 46 | cluster-other-node: 47 | $(exec_verbose) $(RABBITMQCTL) -n $(OTHER_NODE) stop_app 48 | $(verbose) $(RABBITMQCTL) -n $(OTHER_NODE) reset 49 | $(verbose) $(RABBITMQCTL) -n $(OTHER_NODE) join_cluster \ 50 | $(if $(MAIN_NODE),$(MAIN_NODE),$(RABBITMQ_NODENAME)@$$(hostname -s)) 51 | $(verbose) $(RABBITMQCTL) -n $(OTHER_NODE) start_app 52 | -------------------------------------------------------------------------------- /ci/cluster/configuration/rabbitmq.conf: -------------------------------------------------------------------------------- 1 | cluster_formation.peer_discovery_backend = rabbit_peer_discovery_classic_config 2 | cluster_formation.classic_config.nodes.1 = rabbit@node0 3 | cluster_formation.classic_config.nodes.2 = rabbit@node1 4 | cluster_formation.classic_config.nodes.3 = rabbit@node2 5 | loopback_users = none 6 | 7 | listeners.ssl.default = 5671 8 | 9 | ssl_options.cacertfile = /etc/rabbitmq/tls/ca_certificate.pem 10 | ssl_options.certfile = /etc/rabbitmq/tls/server_certificate.pem 11 | ssl_options.keyfile = /etc/rabbitmq/tls/server_key.pem 12 | ssl_options.verify = verify_peer 13 | ssl_options.fail_if_no_peer_cert = false 14 | ssl_options.honor_cipher_order = true 15 | 16 | auth_mechanisms.1 = PLAIN 17 | auth_mechanisms.2 = ANONYMOUS 18 | auth_mechanisms.3 = AMQPLAIN 19 | auth_mechanisms.4 = EXTERNAL 20 | auth_mechanisms.5 = RABBIT-CR-DEMO 21 | -------------------------------------------------------------------------------- /ci/cluster/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | node0: 3 | environment: 4 | - RABBITMQ_ERLANG_COOKIE='secret_cookie' 5 | networks: 6 | - rabbitmq-cluster 7 | hostname: node0 8 | container_name: rabbitmq0 9 | image: ${RABBITMQ_IMAGE:-rabbitmq:4.1} 10 | pull_policy: always 11 | ports: 12 | - "5672:5672" 13 | - "5671:5671" 14 | tty: true 15 | volumes: 16 | - ./configuration/:/etc/rabbitmq/ 17 | - ../../rabbitmq-configuration/tls:/etc/rabbitmq/tls/ 18 | node1: 19 | environment: 20 | - RABBITMQ_ERLANG_COOKIE='secret_cookie' 21 | networks: 22 | - rabbitmq-cluster 23 | hostname: node1 24 | container_name: rabbitmq1 25 | image: ${RABBITMQ_IMAGE:-rabbitmq:4.1} 26 | pull_policy: always 27 | ports: 28 | - "5673:5672" 29 | tty: true 30 | volumes: 31 | - ./configuration/:/etc/rabbitmq/ 32 | - ../../rabbitmq-configuration/tls:/etc/rabbitmq/tls/ 33 | node2: 34 | environment: 35 | - RABBITMQ_ERLANG_COOKIE='secret_cookie' 36 | networks: 37 | - rabbitmq-cluster 38 | hostname: node2 39 | container_name: rabbitmq2 40 | image: ${RABBITMQ_IMAGE:-rabbitmq:4.1} 41 | pull_policy: always 42 | ports: 43 | - "5674:5672" 44 | tty: true 45 | volumes: 46 | - ./configuration/:/etc/rabbitmq/ 47 | - ../../rabbitmq-configuration/tls:/etc/rabbitmq/tls/ 48 | networks: 49 | rabbitmq-cluster: 50 | -------------------------------------------------------------------------------- /ci/release-java-client.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source ./release-versions.txt 4 | git checkout $RELEASE_BRANCH 5 | 6 | ./mvnw release:clean release:prepare -DdryRun=true -Darguments="-DskipTests" --no-transfer-progress \ 7 | --batch-mode -Dtag="v$RELEASE_VERSION" \ 8 | -DreleaseVersion=$RELEASE_VERSION \ 9 | -DdevelopmentVersion=$DEVELOPMENT_VERSION \ 10 | 11 | ./mvnw release:clean release:prepare -Darguments="-DskipTests" --no-transfer-progress \ 12 | --batch-mode -Dtag="v$RELEASE_VERSION" \ 13 | -DreleaseVersion=$RELEASE_VERSION \ 14 | -DdevelopmentVersion=$DEVELOPMENT_VERSION 15 | 16 | git checkout "v$RELEASE_VERSION" 17 | 18 | if [[ $RELEASE_VERSION == *[RCM]* ]] 19 | then 20 | MAVEN_PROFILE="milestone" 21 | echo "prerelease=true" >> $GITHUB_ENV 22 | else 23 | MAVEN_PROFILE="release" 24 | echo "prerelease=false" >> $GITHUB_ENV 25 | fi 26 | 27 | ./mvnw clean deploy -P $MAVEN_PROFILE -DskipTests --no-transfer-progress -------------------------------------------------------------------------------- /ci/start-broker.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | LOCAL_SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | RABBITMQ_IMAGE=${RABBITMQ_IMAGE:-rabbitmq:4.1} 6 | 7 | wait_for_message() { 8 | while ! docker logs "$1" | grep -q "$2"; 9 | do 10 | sleep 5 11 | echo "Waiting 5 seconds for $1 to start..." 12 | done 13 | } 14 | 15 | rm -rf rabbitmq-configuration 16 | mkdir -p rabbitmq-configuration/tls 17 | 18 | make -C "${PWD}"/tls-gen/basic 19 | 20 | rm -rf rabbitmq-configuration 21 | mkdir -p rabbitmq-configuration/tls 22 | cp -R "${PWD}"/tls-gen/basic/result/* rabbitmq-configuration/tls 23 | chmod o+r rabbitmq-configuration/tls/* 24 | chmod g+r rabbitmq-configuration/tls/* 25 | 26 | echo "loopback_users = none 27 | 28 | listeners.ssl.default = 5671 29 | 30 | ssl_options.cacertfile = /etc/rabbitmq/tls/ca_certificate.pem 31 | ssl_options.certfile = /etc/rabbitmq/tls/server_$(hostname)_certificate.pem 32 | ssl_options.keyfile = /etc/rabbitmq/tls/server_$(hostname)_key.pem 33 | ssl_options.verify = verify_peer 34 | ssl_options.fail_if_no_peer_cert = false 35 | ssl_options.honor_cipher_order = true 36 | 37 | auth_mechanisms.1 = PLAIN 38 | auth_mechanisms.2 = ANONYMOUS 39 | auth_mechanisms.3 = AMQPLAIN 40 | auth_mechanisms.4 = EXTERNAL 41 | auth_mechanisms.5 = RABBIT-CR-DEMO" >> rabbitmq-configuration/rabbitmq.conf 42 | 43 | echo "Running RabbitMQ ${RABBITMQ_IMAGE}" 44 | 45 | docker rm -f rabbitmq 2>/dev/null || echo "rabbitmq was not running" 46 | docker run -d --name rabbitmq \ 47 | --network host \ 48 | -v "${PWD}"/rabbitmq-configuration:/etc/rabbitmq \ 49 | "${RABBITMQ_IMAGE}" 50 | 51 | wait_for_message rabbitmq "completed with" 52 | 53 | docker exec rabbitmq rabbitmqctl enable_feature_flag --opt-in khepri_db 54 | docker exec rabbitmq rabbitmq-diagnostics erlang_version 55 | docker exec rabbitmq rabbitmqctl version 56 | -------------------------------------------------------------------------------- /ci/start-cluster.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export RABBITMQ_IMAGE=${RABBITMQ_IMAGE:-rabbitmq:4.1} 4 | 5 | wait_for_message() { 6 | while ! docker logs "$1" | grep -q "$2"; 7 | do 8 | sleep 2 9 | echo "Waiting 2 seconds for $1 to start..." 10 | done 11 | } 12 | 13 | rm -rf rabbitmq-configuration 14 | mkdir -p rabbitmq-configuration/tls 15 | 16 | make -C "${PWD}"/tls-gen/basic 17 | 18 | rm -rf rabbitmq-configuration 19 | mkdir -p rabbitmq-configuration/tls 20 | cp -R "${PWD}"/tls-gen/basic/result/* rabbitmq-configuration/tls 21 | mv rabbitmq-configuration/tls/server_$(hostname)_certificate.pem rabbitmq-configuration/tls/server_certificate.pem 22 | mv rabbitmq-configuration/tls/server_$(hostname)_key.pem rabbitmq-configuration/tls/server_key.pem 23 | chmod o+r rabbitmq-configuration/tls/* 24 | chmod g+r rabbitmq-configuration/tls/* 25 | 26 | docker compose --file ci/cluster/docker-compose.yml down 27 | docker compose --file ci/cluster/docker-compose.yml up --detach 28 | 29 | wait_for_message rabbitmq0 "completed with" 30 | 31 | docker exec rabbitmq0 rabbitmqctl await_online_nodes 3 32 | 33 | docker exec rabbitmq0 rabbitmqctl enable_feature_flag --opt-in khepri_db 34 | docker exec rabbitmq1 rabbitmqctl enable_feature_flag --opt-in khepri_db 35 | docker exec rabbitmq2 rabbitmqctl enable_feature_flag --opt-in khepri_db 36 | 37 | docker exec rabbitmq0 rabbitmqctl cluster_status 38 | 39 | docker compose --file ci/cluster/docker-compose.yml ps 40 | -------------------------------------------------------------------------------- /deploy-javadoc.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | DEPLOY_DIRECTORY=api/current 4 | TAG=$(git describe --exact-match --tags $(git log -n1 --pretty='%h')) 5 | 6 | make deps 7 | ./mvnw -q clean javadoc:javadoc -Dmaven.javadoc.failOnError=false 8 | 9 | if [ -e target/javadoc-bundle-options/element-list ] 10 | then cp target/javadoc-bundle-options/element-list target/reports/apidocs/package-list 11 | fi 12 | 13 | git co gh-pages 14 | rm -rf $DEPLOY_DIRECTORY/* 15 | cp -r target/reports/apidocs/* $DEPLOY_DIRECTORY 16 | git add $DEPLOY_DIRECTORY 17 | git commit -m "Add Javadoc for $TAG" 18 | git push origin gh-pages 19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/channels/channels.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rabbitmq/rabbitmq-java-client/0f47be41d8081bd779d0909753a4f4d7de166cee/doc/channels/channels.pdf -------------------------------------------------------------------------------- /doc/channels/channels.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rabbitmq/rabbitmq-java-client/0f47be41d8081bd779d0909753a4f4d7de166cee/doc/channels/channels.tex -------------------------------------------------------------------------------- /doc/channels/whiteboard.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rabbitmq/rabbitmq-java-client/0f47be41d8081bd779d0909753a4f4d7de166cee/doc/channels/whiteboard.JPG -------------------------------------------------------------------------------- /doc/channels/worktransition.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rabbitmq/rabbitmq-java-client/0f47be41d8081bd779d0909753a4f4d7de166cee/doc/channels/worktransition.pdf -------------------------------------------------------------------------------- /generate-observation-documentation.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ./mvnw -q test-compile exec:java \ 4 | -Dexec.mainClass=io.micrometer.docs.DocsGeneratorCommand \ 5 | -Dexec.classpathScope="test" \ 6 | -Dexec.args='src/main/java/com/rabbitmq/client/observation/micrometer .* target/micrometer-observation-docs' -------------------------------------------------------------------------------- /release-versions.txt: -------------------------------------------------------------------------------- 1 | RELEASE_VERSION="6.0.0.M2" 2 | DEVELOPMENT_VERSION="6.0.0-SNAPSHOT" 3 | RELEASE_BRANCH="main" 4 | -------------------------------------------------------------------------------- /src/main/java/com/rabbitmq/client/AddressResolver.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 2 | // 3 | // This software, the RabbitMQ Java client library, is triple-licensed under the 4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see 6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL, 7 | // please see LICENSE-APACHE2. 8 | // 9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, 10 | // either express or implied. See the LICENSE file for specific language governing 11 | // rights and limitations of this software. 12 | // 13 | // If you have any questions regarding licensing, please contact us at 14 | // info@rabbitmq.com. 15 | 16 | package com.rabbitmq.client; 17 | 18 | import java.io.IOException; 19 | import java.util.ArrayList; 20 | import java.util.Collections; 21 | import java.util.List; 22 | 23 | /** Strategy interface to get the potential servers to connect to. */ 24 | public interface AddressResolver { 25 | 26 | /** 27 | * Get the potential {@link Address}es to connect to. 28 | * 29 | * @return candidate {@link Address}es 30 | * @throws IOException if it encounters a problem 31 | */ 32 | List
getAddresses() throws IOException; 33 | 34 | /** 35 | * Optionally shuffle the list of addresses returned by {@link #getAddresses()}. 36 | * 37 | *The automatic connection recovery calls this method after {@link #getAddresses()} to pick a 38 | * random address for reconnecting. 39 | * 40 | *
The default method implementation calls {@link Collections#shuffle(List)}. Custom 41 | * implementations can choose to not do any shuffling to have more predictability in the 42 | * reconnection. 43 | * 44 | * @param input 45 | * @return potentially shuffled list of addresses. 46 | */ 47 | default List
maybeShuffle(List input) { 48 | List list = new ArrayList(input); 49 | Collections.shuffle(list); 50 | return list; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/rabbitmq/client/AlreadyClosedException.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 2 | // 3 | // This software, the RabbitMQ Java client library, is triple-licensed under the 4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see 6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL, 7 | // please see LICENSE-APACHE2. 8 | // 9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, 10 | // either express or implied. See the LICENSE file for specific language governing 11 | // rights and limitations of this software. 12 | // 13 | // If you have any questions regarding licensing, please contact us at 14 | // info@rabbitmq.com. 15 | 16 | 17 | package com.rabbitmq.client; 18 | 19 | /** 20 | * Thrown when application tries to perform an action on connection/channel 21 | * which was already closed 22 | */ 23 | public class AlreadyClosedException extends ShutdownSignalException { 24 | /** Default for suppressing warnings without version check. */ 25 | private static final long serialVersionUID = 1L; 26 | 27 | public AlreadyClosedException(ShutdownSignalException sse) { 28 | this(sse, null); 29 | } 30 | 31 | public AlreadyClosedException(ShutdownSignalException sse, Throwable cause) { 32 | super(sse.isHardError(), 33 | sse.isInitiatedByApplication(), 34 | sse.getReason(), 35 | sse.getReference(), 36 | composeMessagePrefix(sse), 37 | ((cause == null) ? sse.getCause() : cause)); 38 | } 39 | 40 | private static String composeMessagePrefix(ShutdownSignalException sse) { 41 | String connectionOrChannel = sse.isHardError() ? "connection " : "channel "; 42 | return connectionOrChannel + "is already closed due to "; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/rabbitmq/client/AuthenticationFailureException.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 2 | // 3 | // This software, the RabbitMQ Java client library, is triple-licensed under the 4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see 6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL, 7 | // please see LICENSE-APACHE2. 8 | // 9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, 10 | // either express or implied. See the LICENSE file for specific language governing 11 | // rights and limitations of this software. 12 | // 13 | // If you have any questions regarding licensing, please contact us at 14 | // info@rabbitmq.com. 15 | 16 | package com.rabbitmq.client; 17 | 18 | /** 19 | * Thrown when the broker refuses access due to an authentication failure. 20 | */ 21 | 22 | public class AuthenticationFailureException extends PossibleAuthenticationFailureException 23 | { 24 | public AuthenticationFailureException(String reason) { 25 | super(reason); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/rabbitmq/client/BlockedCallback.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 2 | // 3 | // This software, the RabbitMQ Java client library, is triple-licensed under the 4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see 6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL, 7 | // please see LICENSE-APACHE2. 8 | // 9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, 10 | // either express or implied. See the LICENSE file for specific language governing 11 | // rights and limitations of this software. 12 | // 13 | // If you have any questions regarding licensing, please contact us at 14 | // info@rabbitmq.com. 15 | 16 | package com.rabbitmq.client; 17 | 18 | import java.io.IOException; 19 | 20 | /** 21 | * Implement this interface in order to be notified of connection block events. 22 | * Prefer it over {@link BlockedListener} for a lambda-oriented syntax. 23 | * @see BlockedListener 24 | * @see UnblockedCallback 25 | */ 26 | @FunctionalInterface 27 | public interface BlockedCallback { 28 | 29 | void handle(String reason) throws IOException; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/rabbitmq/client/BlockedListener.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 2 | // 3 | // This software, the RabbitMQ Java client library, is triple-licensed under the 4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see 6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL, 7 | // please see LICENSE-APACHE2. 8 | // 9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, 10 | // either express or implied. See the LICENSE file for specific language governing 11 | // rights and limitations of this software. 12 | // 13 | // If you have any questions regarding licensing, please contact us at 14 | // info@rabbitmq.com. 15 | 16 | 17 | package com.rabbitmq.client; 18 | 19 | import java.io.IOException; 20 | 21 | /** 22 | * Implement this interface in order to be notified of connection block and 23 | * unblock events. 24 | * For a lambda-oriented syntax, use {@link BlockedCallback} and 25 | * {@link UnblockedCallback}. 26 | */ 27 | public interface BlockedListener { 28 | void handleBlocked(String reason) throws IOException; 29 | void handleUnblocked() throws IOException; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/rabbitmq/client/BuiltinExchangeType.java: -------------------------------------------------------------------------------- 1 | package com.rabbitmq.client; 2 | 3 | /** 4 | * Enum for built-in exchange types. 5 | */ 6 | public enum BuiltinExchangeType { 7 | 8 | DIRECT("direct"), FANOUT("fanout"), TOPIC("topic"), HEADERS("headers"); 9 | 10 | private final String type; 11 | 12 | BuiltinExchangeType(String type) { 13 | this.type = type; 14 | } 15 | 16 | public String getType() { 17 | return type; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/rabbitmq/client/ChannelContinuationTimeoutException.java: -------------------------------------------------------------------------------- 1 | package com.rabbitmq.client; 2 | 3 | import java.io.IOException; 4 | import java.util.concurrent.TimeoutException; 5 | 6 | /** 7 | * Exception thrown when a channel times out on a continuation during a RPC call. 8 | * @since 4.1.0 9 | */ 10 | public class ChannelContinuationTimeoutException extends IOException { 11 | 12 | /** 13 | * The channel that performed the call. 14 | * Typed asObject
as the underlying
15 | * object that performs the call might
16 | * not be an implementation of {@link Channel}.
17 | */
18 | private final Object channel;
19 |
20 | /**
21 | * The number of the channel that performed the call.
22 | */
23 | private final int channelNumber;
24 |
25 | /**
26 | * The request method that timed out.
27 | */
28 | private final Method method;
29 |
30 | public ChannelContinuationTimeoutException(TimeoutException cause, Object channel, int channelNumber, Method method) {
31 | super(
32 | "Continuation call for method " + method + " on channel " + channel + " (#" + channelNumber + ") timed out",
33 | cause
34 | );
35 | this.channel = channel;
36 | this.channelNumber = channelNumber;
37 | this.method = method;
38 | }
39 |
40 | /**
41 | *
42 | * @return request method that timed out
43 | */
44 | public Method getMethod() {
45 | return method;
46 | }
47 |
48 | /**
49 | * channel that performed the call
50 | * @return
51 | */
52 | public Object getChannel() {
53 | return channel;
54 | }
55 |
56 | /**
57 | *
58 | * @return number of the channel that performed the call
59 | */
60 | public int getChannelNumber() {
61 | return channelNumber;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/Command.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 |
17 | package com.rabbitmq.client;
18 |
19 | /**
20 | * Interface to a container for an AMQP method-and-arguments, with optional content header and body.
21 | */
22 | public interface Command {
23 | /**
24 | * Retrieves the {@link Method} held within this Command. Downcast to
25 | * concrete (implementation-specific!) subclasses as necessary.
26 | *
27 | * @return the command's method.
28 | */
29 | Method getMethod();
30 |
31 | /**
32 | * Retrieves the ContentHeader subclass instance held as part of this Command, if any.
33 | *
34 | * Downcast to one of the inner classes of AMQP,
35 | * for instance {@link AMQP.BasicProperties}, as appropriate.
36 | *
37 | * @return the Command's {@link ContentHeader}, or null if none
38 | */
39 | ContentHeader getContentHeader();
40 |
41 | /**
42 | * Retrieves the body byte array that travelled as part of this
43 | * Command, if any.
44 | *
45 | * @return the Command's content body, or null if none
46 | */
47 | byte[] getContentBody();
48 | }
49 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/ConfirmCallback.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 |
17 | package com.rabbitmq.client;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * Implement this interface in order to be notified of Confirm events.
23 | * Acks represent messages handled successfully; Nacks represent
24 | * messages lost by the broker. Note, the lost messages could still
25 | * have been delivered to consumers, but the broker cannot guarantee
26 | * this.
27 | * Prefer this interface over {@link ConfirmListener} for
28 | * a lambda-oriented syntax.
29 | * @see ConfirmListener
30 | */
31 | @FunctionalInterface
32 | public interface ConfirmCallback {
33 |
34 | void handle(long deliveryTag, boolean multiple) throws IOException;
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/ConfirmListener.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 |
17 | package com.rabbitmq.client;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * Implement this interface in order to be notified of Confirm events.
23 | * Acks represent messages handled successfully; Nacks represent
24 | * messages lost by the broker. Note, the lost messages could still
25 | * have been delivered to consumers, but the broker cannot guarantee
26 | * this.
27 | * For a lambda-oriented syntax, use {@link ConfirmCallback}.
28 | */
29 | public interface ConfirmListener {
30 | void handleAck(long deliveryTag, boolean multiple)
31 | throws IOException;
32 |
33 | void handleNack(long deliveryTag, boolean multiple)
34 | throws IOException;
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/ConsumerCancelledException.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client;
17 |
18 | import com.rabbitmq.utility.SensibleClone;
19 |
20 | public class ConsumerCancelledException extends RuntimeException implements
21 | SensibleClonebasic.deliver
is received for this consumer.
37 | * @param consumerTag the consumer tag associated with the consumer
38 | * @param message the delivered message
39 | * @throws IOException if the consumer encounters an I/O error while processing the message
40 | */
41 | void handle(String consumerTag, Delivery message) throws IOException;
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/Delivery.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client;
17 |
18 | /**
19 | * Encapsulates an arbitrary message - simple "bean" holder structure.
20 | */
21 | public class Delivery {
22 | private final Envelope _envelope;
23 | private final AMQP.BasicProperties _properties;
24 | private final byte[] _body;
25 |
26 | public Delivery(Envelope envelope, AMQP.BasicProperties properties, byte[] body) {
27 | _envelope = envelope;
28 | _properties = properties;
29 | _body = body;
30 | }
31 |
32 | /**
33 | * Retrieve the message envelope.
34 | * @return the message envelope
35 | */
36 | public Envelope getEnvelope() {
37 | return _envelope;
38 | }
39 |
40 | /**
41 | * Retrieve the message properties.
42 | * @return the message properties
43 | */
44 | public AMQP.BasicProperties getProperties() {
45 | return _properties;
46 | }
47 |
48 | /**
49 | * Retrieve the message body.
50 | * @return the message body
51 | */
52 | public byte[] getBody() {
53 | return _body;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/ListAddressResolver.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client;
17 |
18 | import java.util.List;
19 |
20 | /**
21 | * Simple implementation of {@link AddressResolver} that returns a fixed list.
22 | */
23 | public class ListAddressResolver implements AddressResolver {
24 |
25 | private final List addresses;
26 |
27 | public ListAddressResolver(List addresses) {
28 | this.addresses = addresses;
29 | }
30 |
31 | @Override
32 | public List getAddresses() {
33 | return addresses;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/MalformedFrameException.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 |
17 | package com.rabbitmq.client;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * Encapsulates a frame format error at the wire level.
23 | */
24 | public class MalformedFrameException extends IOException {
25 | /** Standard serialization ID. */
26 | private static final long serialVersionUID = 1L;
27 |
28 | /**
29 | * Instantiate a MalformedFrameException.
30 | * @param reason a string describing the exception
31 | */
32 | public MalformedFrameException(String reason) {
33 | super(reason);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/Method.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 |
17 | package com.rabbitmq.client;
18 |
19 | /**
20 | * Public interface to objects representing an AMQP 0-9-1 method
21 | * @see https://www.rabbitmq.com/specification.html.
22 | */
23 |
24 | public interface Method {
25 | /**
26 | * Retrieve the protocol class ID
27 | * @return the AMQP protocol class ID of this Method
28 | */
29 | int protocolClassId(); /* properly an unsigned short */
30 |
31 | /**
32 | * Retrieve the protocol method ID
33 | * @return the AMQP protocol method ID of this Method
34 | */
35 | int protocolMethodId(); /* properly an unsigned short */
36 |
37 | /**
38 | * Retrieve the method name
39 | * @return the AMQP protocol method name of this Method
40 | */
41 | String protocolMethodName();
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/MissedHeartbeatException.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 |
17 | package com.rabbitmq.client;
18 |
19 | import java.net.SocketTimeoutException;
20 |
21 | /**
22 | * Encapsulates an exception indicating that the connection has missed too many heartbeats
23 | * and is being shut down.
24 | */
25 |
26 | public class MissedHeartbeatException extends SocketTimeoutException {
27 | private static final long serialVersionUID = 1L;
28 |
29 | public MissedHeartbeatException(String reason) {
30 | super(reason);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/PossibleAuthenticationFailureException.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client;
17 |
18 | import java.io.IOException;
19 |
20 | /**
21 | * Thrown when the likely cause is an authentication failure.
22 | */
23 | public class PossibleAuthenticationFailureException extends IOException
24 | {
25 | /** Default for non-checking. */
26 | private static final long serialVersionUID = 1L;
27 |
28 | public PossibleAuthenticationFailureException(Throwable cause)
29 | {
30 | super("Possibly caused by authentication failure");
31 | super.initCause(cause);
32 | }
33 |
34 | public PossibleAuthenticationFailureException(String reason)
35 | {
36 | super(reason);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/Recoverable.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client;
17 |
18 | /**
19 | * Provides a way to register (network, AMQP 0-9-1) connection recovery
20 | * callbacks.
21 | *
22 | * When connection recovery is enabled via {@link ConnectionFactory},
23 | * {@link ConnectionFactory#newConnection()} and {@link Connection#createChannel()}
24 | * return {@link Recoverable} connections and channels.
25 | *
26 | * @see com.rabbitmq.client.impl.recovery.AutorecoveringConnection
27 | * @see com.rabbitmq.client.impl.recovery.AutorecoveringChannel
28 | */
29 | public interface Recoverable {
30 | /**
31 | * Registers a connection recovery callback.
32 | *
33 | * @param listener Callback function
34 | */
35 | void addRecoveryListener(RecoveryListener listener);
36 |
37 | void removeRecoveryListener(RecoveryListener listener);
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/RecoverableChannel.java:
--------------------------------------------------------------------------------
1 | package com.rabbitmq.client;
2 |
3 | import com.rabbitmq.client.Channel;
4 | import com.rabbitmq.client.Recoverable;
5 |
6 | /**
7 | * Convenient interface when working against auto-recovery channels.
8 | *
9 | * @since 4.0.0
10 | */
11 | public interface RecoverableChannel extends Recoverable, Channel {
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/RecoverableConnection.java:
--------------------------------------------------------------------------------
1 | package com.rabbitmq.client;
2 |
3 | /**
4 | * Convenient interface when working against auto-recovery connections.
5 | *
6 | * @since 4.0.0
7 | */
8 | public interface RecoverableConnection extends Recoverable, Connection {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/RecoveryListener.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client;
17 |
18 | /**
19 | * A RecoveryListener receives notifications about completed automatic connection
20 | * recovery.
21 | *
22 | * @since 3.3.0
23 | */
24 | public interface RecoveryListener {
25 | /**
26 | * Invoked when automatic connection recovery has completed.
27 | * This includes topology recovery if it was enabled.
28 | * @param recoverable a {@link Recoverable} connection.
29 | */
30 | void handleRecovery(Recoverable recoverable);
31 |
32 | /**
33 | * Invoked before automatic connection recovery starts.
34 | * This means no recovery steps were performed at this point
35 | * during recovery process.
36 | * @param recoverable a {@link Recoverable} connection.
37 | */
38 | void handleRecoveryStarted(Recoverable recoverable);
39 |
40 | /**
41 | * Invoked before automatic topology recovery starts.
42 | * This means that the connection and channel recovery has completed
43 | * and that exchange/queue/binding/consumer recovery is about to begin.
44 | * @param recoverable a {@link Recoverable} connection.
45 | */
46 | default void handleTopologyRecoveryStarted(Recoverable recoverable) {}
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/ResolvedInetAddress.java:
--------------------------------------------------------------------------------
1 | package com.rabbitmq.client;
2 |
3 | import java.net.InetAddress;
4 | import java.net.InetSocketAddress;
5 |
6 | public class ResolvedInetAddress extends Address {
7 | private final InetAddress inetAddress;
8 |
9 | public ResolvedInetAddress(String originalHostname, InetAddress inetAddress, int port) {
10 | super(originalHostname, port);
11 | this.inetAddress = inetAddress;
12 | }
13 |
14 | @Override
15 | public InetSocketAddress toInetSocketAddress(int port) {
16 | return new InetSocketAddress(inetAddress, port);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/Return.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client;
17 |
18 | /**
19 | *
20 | */
21 | public class Return {
22 |
23 | private final int replyCode;
24 | private final String replyText;
25 | private final String exchange;
26 | private final String routingKey;
27 | private final AMQP.BasicProperties properties;
28 | private final byte[] body;
29 |
30 | public Return(int replyCode, String replyText, String exchange, String routingKey, AMQP.BasicProperties properties, byte[] body) {
31 | this.replyCode = replyCode;
32 | this.replyText = replyText;
33 | this.exchange = exchange;
34 | this.routingKey = routingKey;
35 | this.properties = properties;
36 | this.body = body;
37 | }
38 |
39 | public int getReplyCode() {
40 | return replyCode;
41 | }
42 |
43 | public String getReplyText() {
44 | return replyText;
45 | }
46 |
47 | public String getExchange() {
48 | return exchange;
49 | }
50 |
51 | public String getRoutingKey() {
52 | return routingKey;
53 | }
54 |
55 | public AMQP.BasicProperties getProperties() {
56 | return properties;
57 | }
58 |
59 | public byte[] getBody() {
60 | return body;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/ReturnCallback.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client;
17 |
18 | /**
19 | * Implement this interface in order to be notified of failed
20 | * deliveries when basicPublish is called with "mandatory" or
21 | * "immediate" flags set.
22 | * Prefer this interface over {@link ReturnListener} for
23 | * a simpler, lambda-oriented syntax.
24 | * @see Channel#basicPublish
25 | * @see ReturnListener
26 | * @see Return
27 | */
28 | @FunctionalInterface
29 | public interface ReturnCallback {
30 |
31 | void handle(Return returnMessage);
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/ReturnListener.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 |
17 | package com.rabbitmq.client;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * Implement this interface in order to be notified of failed
23 | * deliveries when basicPublish is called with "mandatory" or
24 | * "immediate" flags set.
25 | * For a lambda-oriented syntax, use {@link ReturnCallback}.
26 | * @see Channel#basicPublish
27 | */
28 | public interface ReturnListener {
29 | void handleReturn(int replyCode,
30 | String replyText,
31 | String exchange,
32 | String routingKey,
33 | AMQP.BasicProperties properties,
34 | byte[] body)
35 | throws IOException;
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/SaslConfig.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client;
17 |
18 | /**
19 | * This interface represents a hook to allow you to control how exactly
20 | * a sasl client is selected during authentication.
21 | * @see com.rabbitmq.client.ConnectionFactory
22 | */
23 | public interface SaslConfig {
24 | SaslMechanism getSaslMechanism(String[] mechanisms);
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/SaslMechanism.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client;
17 |
18 | /**
19 | * Our own view of a SASL authentication mechanism, introduced to remove a
20 | * dependency on javax.security.sasl.
21 | */
22 | public interface SaslMechanism {
23 | /**
24 | * The name of this mechanism (e.g. PLAIN)
25 | * @return the name
26 | */
27 | String getName();
28 |
29 | /**
30 | * Handle one round of challenge-response
31 | * @param challenge the challenge this round, or null on first round.
32 | * @param username name of user
33 | * @param password for username
34 | * @return response
35 | */
36 | LongString handleChallenge(LongString challenge, String username, String password);
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/ShutdownListener.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 |
17 | package com.rabbitmq.client;
18 |
19 | import java.util.EventListener;
20 |
21 | /**
22 | * A ShutdownListener receives information about the shutdown of connections and
23 | * channels. Note that when a connection is shut down, its associated channels are also
24 | * considered shut down and their ShutdownListeners will be notified (with the same cause).
25 | * Because of this, and the fact that channel ShutdownListeners execute in the connection's
26 | * thread, attempting to make blocking calls on a connection inside the listener will
27 | * lead to deadlock.
28 | *
29 | * @see ShutdownNotifier
30 | * @see ShutdownSignalException
31 | */
32 | @FunctionalInterface
33 | public interface ShutdownListener extends EventListener {
34 | void shutdownCompleted(ShutdownSignalException cause);
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/SocketChannelConfigurator.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client;
17 |
18 | import java.io.IOException;
19 | import java.nio.channels.SocketChannel;
20 | import java.util.Objects;
21 |
22 | @FunctionalInterface
23 | public interface SocketChannelConfigurator {
24 |
25 | /**
26 | * Provides a hook to insert custom configuration of the {@link SocketChannel}s
27 | * used to connect to an AMQP server before they connect.
28 | */
29 | void configure(SocketChannel socketChannel) throws IOException;
30 |
31 | /**
32 | * Returns a composed configurator that performs, in sequence, this
33 | * operation followed by the {@code after} operation.
34 | *
35 | * @param after the operation to perform after this operation
36 | * @return a composed configurator that performs in sequence this
37 | * operation followed by the {@code after} operation
38 | * @throws NullPointerException if {@code after} is null
39 | */
40 | default SocketChannelConfigurator andThen(SocketChannelConfigurator after) {
41 | Objects.requireNonNull(after);
42 | return t -> { configure(t); after.configure(t); };
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/SocketConfigurator.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client;
17 |
18 | import java.io.IOException;
19 | import java.net.Socket;
20 | import java.util.Objects;
21 |
22 | @FunctionalInterface
23 | public interface SocketConfigurator {
24 |
25 | /**
26 | * Provides a hook to insert custom configuration of the sockets
27 | * used to connect to an AMQP server before they connect.
28 | */
29 | void configure(Socket socket) throws IOException;
30 |
31 | /**
32 | * Returns a composed configurator that performs, in sequence, this
33 | * operation followed by the {@code after} operation.
34 | *
35 | * @param after the operation to perform after this operation
36 | * @return a composed configurator that performs in sequence this
37 | * operation followed by the {@code after} operation
38 | * @throws NullPointerException if {@code after} is null
39 | */
40 | default SocketConfigurator andThen(SocketConfigurator after) {
41 | Objects.requireNonNull(after);
42 | return t -> {
43 | configure(t);
44 | after.configure(t);
45 | };
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/SslContextFactory.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client;
17 |
18 | import javax.net.ssl.SSLContext;
19 |
20 | /**
21 | * A factory to create {@link SSLContext}s.
22 | *
23 | * @see ConnectionFactory#setSslContextFactory(SslContextFactory)
24 | * @since 5.0.0
25 | */
26 | public interface SslContextFactory {
27 |
28 | /**
29 | * Create a {@link SSLContext} for a given name.
30 | * The name is typically the name of the connection.
31 | * @param name name of the connection the SSLContext is used for
32 | * @return the SSLContext for this name
33 | * @see ConnectionFactory#newConnection(String)
34 | */
35 | SSLContext create(String name);
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/SslEngineConfigurator.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client;
17 |
18 | import javax.net.ssl.SSLEngine;
19 | import java.io.IOException;
20 | import java.util.Objects;
21 |
22 | @FunctionalInterface
23 | public interface SslEngineConfigurator {
24 |
25 | /**
26 | * Provides a hook to insert custom configuration of the {@link SSLEngine}s
27 | * used to connect to an AMQP server before they connect.
28 | * Note this is used only when NIO are in use.
29 | */
30 | void configure(SSLEngine sslEngine) throws IOException;
31 |
32 | /**
33 | * Returns a composed configurator that performs, in sequence, this
34 | * operation followed by the {@code after} operation.
35 | *
36 | * @param after the operation to perform after this operation
37 | * @return a composed configurator that performs in sequence this
38 | * operation followed by the {@code after} operation
39 | * @throws NullPointerException if {@code after} is null
40 | */
41 | default SslEngineConfigurator andThen(SslEngineConfigurator after) {
42 | Objects.requireNonNull(after);
43 | return t -> { configure(t); after.configure(t); };
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/TopologyRecoveryException.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client;
17 |
18 | import com.rabbitmq.client.impl.recovery.RecordedEntity;
19 |
20 | /**
21 | * Indicates an exception thrown during topology recovery.
22 | *
23 | * @see com.rabbitmq.client.ConnectionFactory#setTopologyRecoveryEnabled(boolean)
24 | * @since 3.3.0
25 | */
26 | public class TopologyRecoveryException extends Exception {
27 |
28 | private final RecordedEntity recordedEntity;
29 |
30 | public TopologyRecoveryException(String message, Throwable cause) {
31 | this(message, cause, null);
32 | }
33 |
34 | public TopologyRecoveryException(String message, Throwable cause, final RecordedEntity recordedEntity) {
35 | super(message, cause);
36 | this.recordedEntity = recordedEntity;
37 | }
38 |
39 | public RecordedEntity getRecordedEntity() {
40 | return recordedEntity;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/TrafficListener.java:
--------------------------------------------------------------------------------
1 | package com.rabbitmq.client;
2 |
3 | /**
4 | * Contract to log outbound and inbound {@link Command}s.
5 | *
6 | * @see ConnectionFactory#setTrafficListener(TrafficListener)
7 | * @since 5.5.0
8 | */
9 | public interface TrafficListener {
10 |
11 | /**
12 | * No-op {@link TrafficListener}.
13 | */
14 | TrafficListener NO_OP = new TrafficListener() {
15 |
16 | @Override
17 | public void write(Command outboundCommand) {
18 |
19 | }
20 |
21 | @Override
22 | public void read(Command inboundCommand) {
23 |
24 | }
25 | };
26 |
27 | /**
28 | * Notified for each outbound {@link Command}.
29 | *
30 | * @param outboundCommand
31 | */
32 | void write(Command outboundCommand);
33 |
34 | /**
35 | * Notified for each inbound {@link Command}.
36 | *
37 | * @param inboundCommand
38 | */
39 | void read(Command inboundCommand);
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/UnblockedCallback.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client;
17 |
18 | import java.io.IOException;
19 |
20 | /**
21 | * Implement this interface in order to be notified of connection unblock events.
22 | * Prefer it over {@link BlockedListener} for a lambda-oriented syntax.
23 | * @see BlockedListener
24 | * @see BlockedCallback
25 | */
26 | @FunctionalInterface
27 | public interface UnblockedCallback {
28 |
29 | void handle() throws IOException;
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/UnexpectedFrameError.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 |
17 | package com.rabbitmq.client;
18 |
19 | import com.rabbitmq.client.impl.Frame;
20 |
21 | /**
22 | * Thrown when the command parser hits an unexpected frame type.
23 | */
24 | public class UnexpectedFrameError extends RuntimeException {
25 | private static final long serialVersionUID = 1L;
26 | private final Frame _frame;
27 | private final int _expectedFrameType;
28 |
29 | public UnexpectedFrameError(Frame frame, int expectedFrameType) {
30 | super("Received frame: " + frame + ", expected type " + expectedFrameType);
31 | _frame = frame;
32 | _expectedFrameType = expectedFrameType;
33 | }
34 |
35 | public static long getSerialVersionUID() {
36 | return serialVersionUID;
37 | }
38 |
39 | public Frame getReceivedFrame() {
40 | return _frame;
41 | }
42 |
43 | public int getExpectedFrameType() {
44 | return _expectedFrameType;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/UnknownClassOrMethodId.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 |
17 | package com.rabbitmq.client;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * Thrown when the protocol handlers detect an unknown class number or
23 | * method number.
24 | */
25 | public class UnknownClassOrMethodId extends IOException {
26 | private static final long serialVersionUID = 1L;
27 | private static final int NO_METHOD_ID = -1;
28 | public final int classId;
29 | public final int methodId;
30 | public UnknownClassOrMethodId(int classId) {
31 | this(classId, NO_METHOD_ID);
32 | }
33 | public UnknownClassOrMethodId(int classId, int methodId) {
34 | this.classId = classId;
35 | this.methodId = methodId;
36 | }
37 | @Override
38 | public String toString() {
39 | if (this.methodId == NO_METHOD_ID) {
40 | return super.toString() + "<" + classId + ">";
41 | } else {
42 | return super.toString() + "<" + classId + "." + methodId + ">";
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/UnroutableRpcRequestException.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client;
17 |
18 | /**
19 | * Exception thrown when a RPC request isn't routed to any queue.
20 | * 21 | * The {@link RpcClient} must be configured with the mandatory 22 | * flag set to true with {@link RpcClientParams#useMandatory()}. 23 | * 24 | * @see RpcClientParams#useMandatory() 25 | * @see RpcClient#RpcClient(RpcClientParams) 26 | * @since 5.6.0 27 | */ 28 | public class UnroutableRpcRequestException extends RuntimeException { 29 | 30 | private final Return returnMessage; 31 | 32 | public UnroutableRpcRequestException(Return returnMessage) { 33 | this.returnMessage = returnMessage; 34 | } 35 | 36 | /** 37 | * The returned message. 38 | * 39 | * @return 40 | */ 41 | public Return getReturnMessage() { 42 | return returnMessage; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/rabbitmq/client/impl/AMQBasicProperties.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 2 | // 3 | // This software, the RabbitMQ Java client library, is triple-licensed under the 4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see 6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL, 7 | // please see LICENSE-APACHE2. 8 | // 9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, 10 | // either express or implied. See the LICENSE file for specific language governing 11 | // rights and limitations of this software. 12 | // 13 | // If you have any questions regarding licensing, please contact us at 14 | // info@rabbitmq.com. 15 | 16 | package com.rabbitmq.client.impl; 17 | 18 | import java.io.DataInputStream; 19 | import java.io.IOException; 20 | 21 | import com.rabbitmq.client.BasicProperties; 22 | 23 | public abstract class AMQBasicProperties 24 | extends AMQContentHeader implements BasicProperties { 25 | 26 | protected AMQBasicProperties() { 27 | 28 | } 29 | 30 | protected AMQBasicProperties(DataInputStream in) throws IOException { 31 | super(in); 32 | } 33 | 34 | @Override 35 | public Object clone() throws CloneNotSupportedException { 36 | return super.clone(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/rabbitmq/client/impl/AbstractFrameHandlerFactory.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 2 | // 3 | // This software, the RabbitMQ Java client library, is triple-licensed under the 4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see 6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL, 7 | // please see LICENSE-APACHE2. 8 | // 9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, 10 | // either express or implied. See the LICENSE file for specific language governing 11 | // rights and limitations of this software. 12 | // 13 | // If you have any questions regarding licensing, please contact us at 14 | // info@rabbitmq.com. 15 | 16 | package com.rabbitmq.client.impl; 17 | 18 | import com.rabbitmq.client.SocketConfigurator; 19 | 20 | /** 21 | * 22 | */ 23 | public abstract class AbstractFrameHandlerFactory implements FrameHandlerFactory { 24 | 25 | protected final int connectionTimeout; 26 | protected final SocketConfigurator configurator; 27 | protected final boolean ssl; 28 | protected final int maxInboundMessageBodySize; 29 | 30 | protected AbstractFrameHandlerFactory(int connectionTimeout, SocketConfigurator configurator, 31 | boolean ssl, int maxInboundMessageBodySize) { 32 | this.connectionTimeout = connectionTimeout; 33 | this.configurator = configurator; 34 | this.ssl = ssl; 35 | this.maxInboundMessageBodySize = maxInboundMessageBodySize; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/rabbitmq/client/impl/AnonymousMechanism.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom 2 | // Inc. and/or its subsidiaries. 3 | // 4 | // This software, the RabbitMQ Java client library, is triple-licensed under the 5 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 6 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see 7 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL, 8 | // please see LICENSE-APACHE2. 9 | // 10 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, 11 | // either express or implied. See the LICENSE file for specific language governing 12 | // rights and limitations of this software. 13 | // 14 | // If you have any questions regarding licensing, please contact us at 15 | // info@rabbitmq.com. 16 | 17 | package com.rabbitmq.client.impl; 18 | 19 | import com.rabbitmq.client.LongString; 20 | import com.rabbitmq.client.SaslMechanism; 21 | 22 | /** 23 | * The ANONYMOUS auth mechanism 24 | * 25 | *
Requires RabbitMQ 4.0 or more.
26 | */
27 | public class AnonymousMechanism implements SaslMechanism {
28 | @Override
29 | public String getName() {
30 | return "ANONYMOUS";
31 | }
32 |
33 | @Override
34 | public LongString handleChallenge(LongString challenge, String username, String password) {
35 | return LongStringHelper.asLongString("");
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/impl/CompletableFutureRpcWrapper.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client.impl;
17 |
18 | import com.rabbitmq.client.*;
19 | import com.rabbitmq.client.Method;
20 |
21 | import java.util.concurrent.CompletableFuture;
22 |
23 | /**
24 | *
25 | */
26 | public class CompletableFutureRpcWrapper implements RpcWrapper {
27 |
28 | private final com.rabbitmq.client.Method request;
29 |
30 | private final CompletableFuture
11 | * This implementation checks whether the
6 | * This is a simplified subset of {@link java.util.concurrent.BlockingQueue}.
7 | * This interface is considered a SPI and is likely to move between
8 | * minor and patch releases.
9 | *
10 | * @see NioParams
11 | * @since 5.5.0
12 | */
13 | public interface NioQueue {
14 |
15 | /**
16 | * Enqueue a frame, block if the queue is full.
17 | *
18 | * @param writeRequest
19 | * @return
20 | * @throws InterruptedException
21 | */
22 | boolean offer(WriteRequest writeRequest) throws InterruptedException;
23 |
24 | /**
25 | * Get the current size of the queue.
26 | *
27 | * @return
28 | */
29 | int size();
30 |
31 | /**
32 | * Retrieves and removes the head of this queue,
33 | * or returns {@code null} if this queue is empty.
34 | *
35 | * @return the head of this queue, or {@code null} if this queue is empty
36 | */
37 | WriteRequest poll();
38 |
39 | /**
40 | * Returns {@code true} if the queue contains no element.
41 | *
42 | * @return {@code true} if the queue contains no element
43 | */
44 | boolean isEmpty();
45 | }
46 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/impl/nio/SelectorHolder.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client.impl.nio;
17 |
18 | import java.nio.channels.Selector;
19 | import java.util.Collections;
20 | import java.util.Set;
21 | import java.util.concurrent.ConcurrentHashMap;
22 |
23 | /**
24 | *
25 | */
26 | public class SelectorHolder {
27 |
28 | final Selector selector;
29 |
30 | final SetTRACE
level.
10 | * TRACE
log level
12 | * is enabled before logging anything. This {@link TrafficListener}
13 | * should only be activated for debugging purposes, not in a production
14 | * environment.
15 | *
16 | * @see TrafficListener
17 | * @see com.rabbitmq.client.ConnectionFactory#setTrafficListener(TrafficListener)
18 | * @since 5.5.0
19 | */
20 | public class LogTrafficListener implements TrafficListener {
21 |
22 | private static final Logger LOGGER = LoggerFactory.getLogger(LogTrafficListener.class);
23 |
24 | @Override
25 | public void write(Command outboundCommand) {
26 | if (shouldLog(outboundCommand)) {
27 | LOGGER.trace("Outbound command: {}", outboundCommand);
28 | }
29 | }
30 |
31 | @Override
32 | public void read(Command inboundCommand) {
33 | if (shouldLog(inboundCommand)) {
34 | LOGGER.trace("Inbound command: {}", inboundCommand);
35 | }
36 | }
37 |
38 | protected boolean shouldLog(Command command) {
39 | return LOGGER.isTraceEnabled();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/impl/NetworkConnection.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client.impl;
17 |
18 | import java.net.InetAddress;
19 |
20 | public interface NetworkConnection {
21 |
22 | /**
23 | * Retrieve the local host.
24 | * @return the client socket address.
25 | */
26 | InetAddress getLocalAddress();
27 |
28 | /**
29 | * Retrieve the local port number.
30 | * @return the client socket port number
31 | */
32 | int getLocalPort();
33 |
34 | /** Retrieve address of peer. */
35 | InetAddress getAddress();
36 |
37 | /** Retrieve port number of peer. */
38 | int getPort();
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/impl/OAuthTokenManagementException.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2019-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client.impl;
17 |
18 | public class OAuthTokenManagementException extends RuntimeException {
19 |
20 | public OAuthTokenManagementException(String message, Throwable cause) {
21 | super(message, cause);
22 | }
23 |
24 | public OAuthTokenManagementException(String message) {
25 | super(message);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/impl/PlainMechanism.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client.impl;
17 |
18 | import com.rabbitmq.client.LongString;
19 | import com.rabbitmq.client.SaslMechanism;
20 |
21 | /**
22 | * The PLAIN auth mechanism
23 | */
24 | public class PlainMechanism implements SaslMechanism {
25 | @Override
26 | public String getName() {
27 | return "PLAIN";
28 | }
29 |
30 | @Override
31 | public LongString handleChallenge(LongString challenge,
32 | String username,
33 | String password) {
34 | return LongStringHelper.asLongString("\0" + username +
35 | "\0" + password);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/impl/RpcContinuationRpcWrapper.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client.impl;
17 |
18 | import com.rabbitmq.client.ShutdownSignalException;
19 |
20 | /**
21 | *
22 | */
23 | public class RpcContinuationRpcWrapper implements RpcWrapper {
24 |
25 | private final AMQChannel.RpcContinuation continuation;
26 |
27 | public RpcContinuationRpcWrapper(AMQChannel.RpcContinuation continuation) {
28 | this.continuation = continuation;
29 | }
30 |
31 | @Override
32 | public boolean canHandleReply(AMQCommand command) {
33 | return continuation.canHandleReply(command);
34 | }
35 |
36 | @Override
37 | public void complete(AMQCommand command) {
38 | continuation.handleCommand(command);
39 | }
40 |
41 | @Override
42 | public void shutdown(ShutdownSignalException signal) {
43 | continuation.handleShutdownSignal(signal);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/impl/RpcWrapper.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client.impl;
17 |
18 | import com.rabbitmq.client.ShutdownSignalException;
19 |
20 | /**
21 | *
22 | */
23 | public interface RpcWrapper {
24 |
25 | boolean canHandleReply(AMQCommand command);
26 |
27 | void complete(AMQCommand command);
28 |
29 | void shutdown(ShutdownSignalException signal);
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/impl/UnknownChannelException.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 |
17 | package com.rabbitmq.client.impl;
18 |
19 | class UnknownChannelException extends RuntimeException {
20 | /** Default for non-checking. */
21 | private static final long serialVersionUID = 1L;
22 | private final int channelNumber;
23 |
24 | public UnknownChannelException(int channelNumber) {
25 | super("Unknown channel number " + channelNumber);
26 | this.channelNumber = channelNumber;
27 | }
28 |
29 | public int getChannelNumber() {
30 | return channelNumber;
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/impl/Utils.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client.impl;
17 |
18 | final class Utils {
19 |
20 | private static final int AVAILABLE_PROCESSORS =
21 | Integer.parseInt(
22 | System.getProperty(
23 | "rabbitmq.amqp.client.availableProcessors",
24 | String.valueOf(Runtime.getRuntime().availableProcessors())));
25 |
26 | static int availableProcessors() {
27 | return AVAILABLE_PROCESSORS;
28 | }
29 |
30 | private Utils() {}
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/impl/WorkPoolFullException.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
2 | //
3 | // This software, the RabbitMQ Java client library, is triple-licensed under the
4 | // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
5 | // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6 | // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7 | // please see LICENSE-APACHE2.
8 | //
9 | // This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10 | // either express or implied. See the LICENSE file for specific language governing
11 | // rights and limitations of this software.
12 | //
13 | // If you have any questions regarding licensing, please contact us at
14 | // info@rabbitmq.com.
15 |
16 | package com.rabbitmq.client.impl;
17 |
18 | /**
19 | * Exception thrown when {@link WorkPool} enqueueing times out.
20 | */
21 | public class WorkPoolFullException extends RuntimeException {
22 |
23 | public WorkPoolFullException(String msg) {
24 | super(msg);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/com/rabbitmq/client/impl/nio/BlockingQueueNioQueue.java:
--------------------------------------------------------------------------------
1 | package com.rabbitmq.client.impl.nio;
2 |
3 | import java.util.concurrent.BlockingQueue;
4 | import java.util.concurrent.TimeUnit;
5 |
6 | /**
7 | * Bridge between {@link NioQueue} and JDK's {@link BlockingQueue}.
8 | *
9 | * @see NioQueue
10 | * @since 5.5.0
11 | */
12 | public class BlockingQueueNioQueue implements NioQueue {
13 |
14 | private final BlockingQueue