Refine Reactor-based TCP client implementation
Configure explicitly use of SynchronousDispatcher instead of the one used otherwise by default (RingBufferDispatcher). As a result TCP optations are now scoped to Netty's threads. Remove Environment field. It is no longer required to shut it down since we're now using SynchronousDispatcher by default. Replace connection.in() with connection.consume() when composing connection handling. The former creates a Stream for further composing, e.g. via map(), filter() but all we need is to read a message. Provide additional constructor that aceepts a pre-configured Reactor TcpClient instance. Issue: SPR-11531
This commit is contained in:
@@ -68,10 +68,10 @@ public class BrokerMessageHandlerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void stopShouldPublishBrokerAvailabilityEvent() {
|
||||
public void startAndStopShouldNotPublishBrokerAvailabilityEvents() {
|
||||
this.handler.start();
|
||||
this.handler.stop();
|
||||
assertEquals(Arrays.asList(true, false), this.handler.availabilityEvents);
|
||||
assertEquals(Collections.emptyList(), this.handler.availabilityEvents);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -136,11 +136,6 @@ public class BrokerMessageHandlerTests {
|
||||
setApplicationEventPublisher(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void startInternal() {
|
||||
publishBrokerAvailableEvent();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleMessageInternal(Message<?> message) {
|
||||
this.messages.add(message);
|
||||
|
||||
Reference in New Issue
Block a user