You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2020/10/28 04:53:35 UTC
[james-project] 10/10: Update RabbitMQConnectionFactory.java
This is an automated email from the ASF dual-hosted git repository.
btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 85a9af8b818afff8a4a380f6021c63ce9fdef46a
Author: wnfkwnfk <45...@users.noreply.github.com>
AuthorDate: Tue Oct 27 22:01:20 2020 +0800
Update RabbitMQConnectionFactory.java
when rabbitmq change guest's password, it cannot be connected and will throw exception:
An unexpected connection driver error occured (Exception message: Socket closed)
so we should set username and password here to make it work correctly
---
.../org/apache/james/backends/rabbitmq/RabbitMQConnectionFactory.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/RabbitMQConnectionFactory.java b/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/RabbitMQConnectionFactory.java
index 36989f9..cb45fc7 100644
--- a/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/RabbitMQConnectionFactory.java
+++ b/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/RabbitMQConnectionFactory.java
@@ -50,6 +50,10 @@ public class RabbitMQConnectionFactory {
connectionFactory.setChannelRpcTimeout(rabbitMQConfiguration.getChannelRpcTimeoutInMs());
connectionFactory.setConnectionTimeout(rabbitMQConfiguration.getConnectionTimeoutInMs());
connectionFactory.setNetworkRecoveryInterval(rabbitMQConfiguration.getNetworkRecoveryIntervalInMs());
+
+ connectionFactory.setUsername(rabbitMQConfiguration.getManagementCredentials().getUser());
+ connectionFactory.setPassword(String.valueOf(rabbitMQConfiguration.getManagementCredentials().getPassword()));
+
return connectionFactory;
} catch (Exception e) {
throw new RuntimeException(e);
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org