Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] How to configure rabbitmq client when pulsar broker use AuthenticationProviderToken #959

Open
zhaoli2333 opened this issue Jul 13, 2023 · 0 comments
Labels

Comments

@zhaoli2333
Copy link

zhaoli2333 commented Jul 13, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant