FINERACT-1694-Asynchronous-Message-OutChannel-Rename
This commit is contained in:
committed by
Aleksandar Vidakovic
parent
40b6eb50f6
commit
44cab78cbb
+3
-3
@@ -39,14 +39,14 @@ import org.springframework.integration.jms.dsl.Jms;
|
||||
public class ExternalEventJMSProducerConfiguration {
|
||||
|
||||
@Autowired
|
||||
private DirectChannel outboundRequests;
|
||||
private DirectChannel outboundRequestsEvents;
|
||||
|
||||
@Autowired
|
||||
private FineractProperties fineractProperties;
|
||||
|
||||
@Bean
|
||||
public IntegrationFlow outboundFlow(ActiveMQConnectionFactory connectionFactory) {
|
||||
return IntegrationFlows.from(outboundRequests) //
|
||||
public IntegrationFlow outboundFlowEvents(ActiveMQConnectionFactory connectionFactory) {
|
||||
return IntegrationFlows.from(outboundRequestsEvents) //
|
||||
.log(LoggingHandler.Level.DEBUG) //
|
||||
.handle(Jms.outboundAdapter(connectionFactory)
|
||||
.destination(fineractProperties.getEvents().getExternal().getProducer().getJms().getEventQueueName()))
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import org.springframework.integration.config.EnableIntegration;
|
||||
public class ExternalEventProducerConfiguration {
|
||||
|
||||
@Bean
|
||||
public DirectChannel outboundRequests() {
|
||||
public DirectChannel outboundRequestsEvents() {
|
||||
return new DirectChannel();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -27,6 +27,6 @@ import org.springframework.integration.annotation.MessagingGateway;
|
||||
@ConditionalOnProperty(value = "fineract.events.external.enabled", havingValue = "true")
|
||||
public interface ExternalEventProducer {
|
||||
|
||||
@Gateway(requestChannel = "outboundRequests", replyTimeout = 2, requestTimeout = 200)
|
||||
@Gateway(requestChannel = "outboundRequestsEvents", replyTimeout = 2, requestTimeout = 200)
|
||||
void sendEvent(byte[] message) throws AcknowledgementTimeoutException;
|
||||
}
|
||||
|
||||
+7
-7
@@ -54,8 +54,8 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||
public class EventsJMSIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("outboundRequests")
|
||||
private DirectChannel outboundRequests;
|
||||
@Qualifier("outboundRequestsEvents")
|
||||
private DirectChannel outboundRequestsEvents;
|
||||
|
||||
@Autowired
|
||||
private ContextConfiguration.TestChannelInterceptor testChannelInterceptor;
|
||||
@@ -65,7 +65,7 @@ public class EventsJMSIntegrationTest {
|
||||
|
||||
@Test
|
||||
public void testJmsDownstreamChannelIntegration() {
|
||||
assertThat(outboundRequests.getSubscriberCount()).isEqualTo(1);
|
||||
assertThat(outboundRequestsEvents.getSubscriberCount()).isEqualTo(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -74,7 +74,7 @@ public class EventsJMSIntegrationTest {
|
||||
underTest.sendEvent(new byte[0]);
|
||||
underTest.sendEvent(new byte[0]);
|
||||
// then
|
||||
assertTrue(outboundRequests.getInterceptors().contains(this.testChannelInterceptor));
|
||||
assertTrue(outboundRequestsEvents.getInterceptors().contains(this.testChannelInterceptor));
|
||||
assertThat(testChannelInterceptor.getInvoked()).isEqualTo(2);
|
||||
|
||||
}
|
||||
@@ -87,19 +87,19 @@ public class EventsJMSIntegrationTest {
|
||||
private static ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
|
||||
|
||||
@Bean
|
||||
public DirectChannel outboundRequests() {
|
||||
public DirectChannel outboundRequestsEvents() {
|
||||
return new DirectChannel();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public IntegrationFlow outboundFlow() {
|
||||
return IntegrationFlows.from("outboundRequests") //
|
||||
return IntegrationFlows.from("outboundRequestsEvents") //
|
||||
.log(LoggingHandler.Level.DEBUG) //
|
||||
.handle(Jms.outboundAdapter(connectionFactory).destination("destinationChannel")).get();
|
||||
}
|
||||
|
||||
@Component
|
||||
@GlobalChannelInterceptor(patterns = "outboundRequests")
|
||||
@GlobalChannelInterceptor(patterns = "outboundRequestsEvents")
|
||||
public static class TestChannelInterceptor implements ChannelInterceptor {
|
||||
|
||||
private final AtomicInteger invoked = new AtomicInteger();
|
||||
|
||||
Reference in New Issue
Block a user