-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Labels
Description
How to configure rabbitmq client when pulsar broker use AuthenticationProviderToken as authenticationProviders?
Here is my code:
ConnectionFactory connectionFactory = new ConnectionFactory();
connectionFactory.setVirtualHost("vhost1");
connectionFactory.setHost("xxxxxx");
connectionFactory.setPort(5672);
connectionFactory.setUsername("admin");
connectionFactory.setPassword("xxxxxxxx");
connectionFactory.setSaslConfig(DefaultSaslConfig.PLAIN);
Connection connection = connectionFactory.newConnection();
Channel channel = connection.createChannel();
and I got the error:
com.rabbitmq.client.PossibleAuthenticationFailureException: Possibly caused by authentication failure
at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:387)
at com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnectionFactory.newConnection(RecoveryAwareAMQConnectionFactory.java:64)
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.init(AutorecoveringConnection.java:156)
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1110)
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1067)
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1025)
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1187)
at pulsar.aop.AopProducerDemo.send(AopProducerDemo.java:30)
at pulsar.aop.AopProducerDemo.main(AopProducerDemo.java:15)
Caused by: com.rabbitmq.client.ShutdownSignalException: connection error; protocol method: #method<connection.close>(reply-code=320, reply-text=No authentication provider is configured, class-id=10, method-id=11)
at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66)
at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36)
at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:502)
at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:330)
at com.rabbitmq.client.impl.AMQChannel.rpc(AMQChannel.java:275)
at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:372)
... 8 more