File tree Expand file tree Collapse file tree 2 files changed +26
-11
lines changed
main/java/com/rabbitmq/client/amqp/impl
test/java/com/rabbitmq/client/amqp/impl Expand file tree Collapse file tree 2 files changed +26
-11
lines changed Original file line number Diff line number Diff line change 26
26
import java .util .concurrent .atomic .AtomicBoolean ;
27
27
import java .util .concurrent .atomic .AtomicLong ;
28
28
import org .apache .qpid .protonj2 .client .*;
29
+ import org .apache .qpid .protonj2 .client .futures .ClientFutureFactory ;
29
30
30
31
class AmqpEnvironment implements Environment {
31
32
@@ -55,7 +56,7 @@ class AmqpEnvironment implements Environment {
55
56
this .id = ID_SEQUENCE .getAndIncrement ();
56
57
connectionSettings .copyTo (this .connectionSettings );
57
58
this .connectionSettings .consolidate ();
58
- ClientOptions clientOptions = new ClientOptions ();
59
+ ClientOptions clientOptions = new ClientOptions (). futureType ( ClientFutureFactory . PROGRESSIVE ) ;
59
60
this .client = Client .create (clientOptions );
60
61
61
62
if (executorService == null ) {
Original file line number Diff line number Diff line change 42
42
import org .slf4j .LoggerFactory ;
43
43
44
44
@ DisabledIfNotCluster
45
- @ Disabled
46
45
public class RecoveryClusterTest {
47
46
48
47
private static final Logger LOGGER = LoggerFactory .getLogger (RecoveryClusterTest .class );
@@ -60,20 +59,21 @@ public class RecoveryClusterTest {
60
59
@ BeforeAll
61
60
static void initAll () {
62
61
nodes = Cli .nodes ();
62
+ LOGGER .info ("Available processor(s): {}" , Runtime .getRuntime ().availableProcessors ());
63
63
}
64
64
65
65
@ BeforeEach
66
66
void init (TestInfo info ) {
67
67
environment =
68
68
new AmqpEnvironmentBuilder ().connectionSettings ().uris (URIS ).environmentBuilder ().build ();
69
69
this .connection =
70
- ( AmqpConnection )
71
- environment
72
- . connectionBuilder ( )
73
- .recovery ()
74
- .backOffDelayPolicy (BACK_OFF_DELAY_POLICY )
75
- .connectionBuilder ()
76
- .build ();
70
+ connection (
71
+ b ->
72
+ b . name ( "c-management" )
73
+ .recovery ()
74
+ .backOffDelayPolicy (BACK_OFF_DELAY_POLICY )
75
+ .connectionBuilder ()
76
+ .build () );
77
77
this .management = connection .management ();
78
78
this .testInfo = info ;
79
79
}
@@ -92,22 +92,36 @@ void clusterRestart() {
92
92
List <ConsumerState > consumerStates = Collections .emptyList ();
93
93
try {
94
94
qqNames .forEach (n -> management .queue (n ).type (Management .QueueType .QUORUM ).declare ());
95
+ AtomicInteger counter = new AtomicInteger (0 );
95
96
consumerStates =
96
97
qqNames .stream ()
97
98
.map (
98
99
n ->
99
100
new ConsumerState (
100
101
n ,
101
- connection (b -> b .affinity ().queue (n ).operation (CONSUME ).connection ())))
102
+ connection (
103
+ b ->
104
+ b .name ("consumer-" + counter .getAndIncrement ())
105
+ .affinity ()
106
+ .queue (n )
107
+ .operation (CONSUME )
108
+ .connection ())))
102
109
.collect (toList ());
103
110
111
+ counter .set (0 );
104
112
publisherStates =
105
113
qqNames .stream ()
106
114
.map (
107
115
n ->
108
116
new PublisherState (
109
117
n ,
110
- connection (b -> b .affinity ().queue (n ).operation (PUBLISH ).connection ())))
118
+ connection (
119
+ b ->
120
+ b .name ("publisher-" + counter .getAndIncrement ())
121
+ .affinity ()
122
+ .queue (n )
123
+ .operation (PUBLISH )
124
+ .connection ())))
111
125
.collect (toList ());
112
126
113
127
publisherStates .forEach (PublisherState ::start );
You can’t perform that action at this time.
0 commit comments