Skip to content

Commit

Permalink
Fix addressResolver afte merge conflict
Browse files Browse the repository at this point in the history
Related to #1198
  • Loading branch information
artembilan committed May 17, 2020
1 parent 8d72e57 commit 445bd27
Showing 1 changed file with 3 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -484,27 +484,7 @@ protected final Connection createBareConnection() {
try {
String connectionName = this.connectionNameStrategy.obtainNewConnectionName(this);

com.rabbitmq.client.Connection rabbitConnection;
if (this.addresses != null) {
List<Address> addressesToConnect = this.addresses;
if (this.shuffleAddresses && addressesToConnect.size() > 1) {
List<Address> list = new ArrayList<>(addressesToConnect);
Collections.shuffle(list);
addressesToConnect = list;
}
if (this.logger.isInfoEnabled()) {
this.logger.info("Attempting to connect to: " + addressesToConnect);
}
rabbitConnection = this.rabbitConnectionFactory.newConnection(this.executorService, addressesToConnect,
connectionName);
}
else {
if (this.logger.isInfoEnabled()) {
this.logger.info("Attempting to connect to: " + this.rabbitConnectionFactory.getHost()
+ ":" + this.rabbitConnectionFactory.getPort());
}
rabbitConnection = this.rabbitConnectionFactory.newConnection(this.executorService, connectionName);
}
com.rabbitmq.client.Connection rabbitConnection = connect(connectionName);

Connection connection = new SimpleConnection(rabbitConnection, this.closeTimeout);
if (rabbitConnection instanceof AutorecoveringConnection) {
Expand Down Expand Up @@ -535,7 +515,8 @@ public void handleRecovery(Recoverable recoverable) {
}

if (this.applicationEventPublisher != null) {
connection.addBlockedListener(new ConnectionBlockedListener(connection, this.applicationEventPublisher));
connection.addBlockedListener(new ConnectionBlockedListener(connection,
this.applicationEventPublisher));
}

return connection;
Expand Down

0 comments on commit 445bd27

Please sign in to comment.