Skip to content

Commit 9ca8df4

Browse files
committed
Adjust log level
1 parent fe1b3bd commit 9ca8df4

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/main/java/com/rabbitmq/client/amqp/impl/ConnectionUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,14 @@ static AmqpConnection.NativeConnectionWrapper enforceAffinity(
159159
"Error while closing native connection while enforcing affinity: {}", ex.getMessage());
160160
}
161161
management.markUnavailable();
162-
LOGGER.warn(
162+
LOGGER.info(
163163
"Cannot enforce affinity {} of '{}' because connection has been closed",
164164
context,
165165
connectionName,
166166
e);
167167
throw e;
168168
} catch (RuntimeException e) {
169-
LOGGER.warn(
169+
LOGGER.info(
170170
"Cannot enforce affinity {} of '{}' error when looking up queue",
171171
context,
172172
connectionName,

src/test/java/com/rabbitmq/client/amqp/impl/RecoveryClusterTest.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import java.time.format.DateTimeFormatter;
4444
import java.util.Collections;
4545
import java.util.List;
46+
import java.util.Random;
4647
import java.util.concurrent.ExecutorService;
4748
import java.util.concurrent.Executors;
4849
import java.util.concurrent.ThreadFactory;
@@ -68,7 +69,7 @@ public class RecoveryClusterTest {
6869

6970
private static final Logger LOGGER = LoggerFactory.getLogger(RecoveryClusterTest.class);
7071

71-
static final Duration TIMEOUT = Duration.ofSeconds(20);
72+
static final Duration TIMEOUT = Duration.ofSeconds(35);
7273
static final String[] URIS =
7374
new String[] {"amqp://localhost:5672", "amqp://localhost:5673", "amqp://localhost:5674"};
7475
static final Duration RECOVERY_INITIAL_DELAY = Duration.ofSeconds(10);
@@ -333,30 +334,26 @@ void clusterRestart() {
333334
private List<QueueConfiguration> queueConfigurations(
334335
List<Management.QueueType> queueTypes, int queueCount) {
335336
AtomicInteger classicQueueCount = new AtomicInteger(0);
337+
String suffix = "rec-" + new Random().nextInt(1000);
336338
return queueTypes.stream()
337339
.flatMap(
338340
(Function<Management.QueueType, Stream<QueueConfiguration>>)
339341
type ->
340342
IntStream.range(0, queueCount)
341343
.mapToObj(
342-
ignored -> {
344+
i -> {
343345
boolean exclusive =
344346
type == Management.QueueType.CLASSIC
345347
&& classicQueueCount.incrementAndGet() > queueCount;
346-
String prefix =
347-
type.name().toLowerCase() + (exclusive ? "-ex-" : "-");
348-
String n = name(prefix);
348+
String prefix = type.name().toLowerCase() + (exclusive ? "-ex" : "");
349+
String n = String.format("%s-%s-%02d", prefix, suffix, i);
349350
UnaryOperator<Management.QueueSpecification> c =
350351
s -> s.type(type).exclusive(exclusive);
351352
return new QueueConfiguration(n, type, exclusive, c);
352353
}))
353354
.collect(toList());
354355
}
355356

356-
String name(String prefix) {
357-
return prefix + TestUtils.name(this.testInfo);
358-
}
359-
360357
private static class PublisherState implements AutoCloseable {
361358

362359
private static final ThreadFactory THREAD_FACTORY =

0 commit comments

Comments
 (0)