Skip to content

Commit 445bd27

Browse files
committed
Fix addressResolver afte merge conflict
Related to #1198
1 parent 8d72e57 commit 445bd27

File tree

1 file changed

+3
-22
lines changed

1 file changed

+3
-22
lines changed

spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/AbstractConnectionFactory.java

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -484,27 +484,7 @@ protected final Connection createBareConnection() {
484484
try {
485485
String connectionName = this.connectionNameStrategy.obtainNewConnectionName(this);
486486

487-
com.rabbitmq.client.Connection rabbitConnection;
488-
if (this.addresses != null) {
489-
List<Address> addressesToConnect = this.addresses;
490-
if (this.shuffleAddresses && addressesToConnect.size() > 1) {
491-
List<Address> list = new ArrayList<>(addressesToConnect);
492-
Collections.shuffle(list);
493-
addressesToConnect = list;
494-
}
495-
if (this.logger.isInfoEnabled()) {
496-
this.logger.info("Attempting to connect to: " + addressesToConnect);
497-
}
498-
rabbitConnection = this.rabbitConnectionFactory.newConnection(this.executorService, addressesToConnect,
499-
connectionName);
500-
}
501-
else {
502-
if (this.logger.isInfoEnabled()) {
503-
this.logger.info("Attempting to connect to: " + this.rabbitConnectionFactory.getHost()
504-
+ ":" + this.rabbitConnectionFactory.getPort());
505-
}
506-
rabbitConnection = this.rabbitConnectionFactory.newConnection(this.executorService, connectionName);
507-
}
487+
com.rabbitmq.client.Connection rabbitConnection = connect(connectionName);
508488

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

537517
if (this.applicationEventPublisher != null) {
538-
connection.addBlockedListener(new ConnectionBlockedListener(connection, this.applicationEventPublisher));
518+
connection.addBlockedListener(new ConnectionBlockedListener(connection,
519+
this.applicationEventPublisher));
539520
}
540521

541522
return connection;

0 commit comments

Comments
 (0)