From c7381dfbeb3193394d744d8d0cef8f8221a55eff Mon Sep 17 00:00:00 2001 From: Artem Sidorkin Date: Fri, 5 Jul 2019 18:19:32 +0300 Subject: [PATCH] Updated tram --- eventuate-tram-examples-common/build.gradle | 4 ++-- .../AbstractTramCommandTestConfiguration.java | 12 +++++----- .../AbstractTramEventTestConfiguration.java | 22 +++++++------------ ...cActiveMQTramCommandTestConfiguration.java | 2 +- ...dbcActiveMQTramEventTestConfiguration.java | 2 +- ...cActiveMQTramMessageTestConfiguration.java | 2 +- ...cRabbitMQTramCommandTestConfiguration.java | 2 +- ...dbcRabbitMQTramEventTestConfiguration.java | 2 +- ...cRabbitMQTramMessageTestConfiguration.java | 2 +- gradle.properties | 2 +- settings.gradle | 2 +- 11 files changed, 25 insertions(+), 29 deletions(-) diff --git a/eventuate-tram-examples-common/build.gradle b/eventuate-tram-examples-common/build.gradle index e4106e2..fff2ac1 100644 --- a/eventuate-tram-examples-common/build.gradle +++ b/eventuate-tram-examples-common/build.gradle @@ -1,7 +1,7 @@ dependencies { - compile "io.eventuate.tram.core:eventuate-tram-messaging:$eventuateTramVersion" + compile "io.eventuate.tram.core:eventuate-tram-messaging-spring:$eventuateTramVersion" compile "io.eventuate.tram.core:eventuate-tram-commands:$eventuateTramVersion" - compile "io.eventuate.tram.core:eventuate-tram-events:$eventuateTramVersion" + compile "io.eventuate.tram.core:eventuate-tram-events-spring:$eventuateTramVersion" compile "org.springframework.boot:spring-boot-starter:$springBootVersion" diff --git a/eventuate-tram-examples-common/src/main/java/io/eventuate/tram/examples/basic/commands/AbstractTramCommandTestConfiguration.java b/eventuate-tram-examples-common/src/main/java/io/eventuate/tram/examples/basic/commands/AbstractTramCommandTestConfiguration.java index a5a6cc2..1bf9142 100644 --- a/eventuate-tram-examples-common/src/main/java/io/eventuate/tram/examples/basic/commands/AbstractTramCommandTestConfiguration.java +++ b/eventuate-tram-examples-common/src/main/java/io/eventuate/tram/examples/basic/commands/AbstractTramCommandTestConfiguration.java @@ -1,9 +1,11 @@ package io.eventuate.tram.examples.basic.commands; -import io.eventuate.tram.commands.common.ChannelMapping; -import io.eventuate.tram.commands.common.DefaultChannelMapping; import io.eventuate.tram.commands.consumer.CommandDispatcher; +import io.eventuate.tram.commands.consumer.CommandDispatcherFactory; +import io.eventuate.tram.commands.consumer.TramCommandConsumerConfiguration; import io.eventuate.tram.commands.producer.TramCommandProducerConfiguration; +import io.eventuate.tram.messaging.common.ChannelMapping; +import io.eventuate.tram.messaging.common.DefaultChannelMapping; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @@ -11,7 +13,7 @@ import java.util.Collections; @Configuration -@Import(TramCommandProducerConfiguration.class) +@Import({TramCommandProducerConfiguration.class, TramCommandConsumerConfiguration.class}) public class AbstractTramCommandTestConfiguration { @Bean @@ -26,8 +28,8 @@ public TramCommandTestCommandHandler abstractTramCommandTestTarget(AbstractTramC } @Bean - public CommandDispatcher commandDispatcher(AbstractTramCommandTestConfig config, TramCommandTestCommandHandler target) { - return new CommandDispatcher(config.getCommandDispatcheId(), target.getCommandHandlers()); + public CommandDispatcher commandDispatcher(CommandDispatcherFactory commandDispatcherFactory, AbstractTramCommandTestConfig config, TramCommandTestCommandHandler target) { + return commandDispatcherFactory.make(config.getCommandDispatcheId(), target.getCommandHandlers()); } @Bean diff --git a/eventuate-tram-examples-common/src/main/java/io/eventuate/tram/examples/basic/events/AbstractTramEventTestConfiguration.java b/eventuate-tram-examples-common/src/main/java/io/eventuate/tram/examples/basic/events/AbstractTramEventTestConfiguration.java index d3b23da..d35f671 100644 --- a/eventuate-tram-examples-common/src/main/java/io/eventuate/tram/examples/basic/events/AbstractTramEventTestConfiguration.java +++ b/eventuate-tram-examples-common/src/main/java/io/eventuate/tram/examples/basic/events/AbstractTramEventTestConfiguration.java @@ -1,19 +1,15 @@ package io.eventuate.tram.examples.basic.events; -import io.eventuate.tram.events.publisher.TramEventsPublisherConfiguration; +import io.eventuate.tram.events.spring.publisher.TramEventsPublisherConfiguration; +import io.eventuate.tram.events.spring.subscriber.TramEventSubscriberConfiguration; import io.eventuate.tram.events.subscriber.DomainEventDispatcher; -import io.eventuate.tram.examples.basic.events.domain.AccountDebited; -import io.eventuate.tram.messaging.consumer.MessageConsumer; +import io.eventuate.tram.events.subscriber.DomainEventDispatcherFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; -import java.util.Collections; - -import static java.util.Collections.singleton; - @Configuration -@Import(TramEventsPublisherConfiguration.class) +@Import({TramEventsPublisherConfiguration.class, TramEventSubscriberConfiguration.class}) public class AbstractTramEventTestConfiguration { @Bean @@ -22,12 +18,10 @@ public AbstractTramEventTestConfig abstractTramEventTestConfig() { } @Bean - public DomainEventDispatcher domainEventDispatcher(AbstractTramEventTestConfig config, - TramEventTestEventConsumer target, - MessageConsumer messageConsumer) { - return new DomainEventDispatcher("eventDispatcherId" + config.getUniqueId(), - target.domainEventHandlers(), - messageConsumer); + public DomainEventDispatcher domainEventDispatcher(DomainEventDispatcherFactory domainEventDispatcherFactory, + AbstractTramEventTestConfig config, + TramEventTestEventConsumer target) { + return domainEventDispatcherFactory.make("eventDispatcherId" + config.getUniqueId(), target.domainEventHandlers()); } @Bean diff --git a/eventuate-tram-examples-jdbc-activemq/src/test/java/io/eventuate/tram/examples/basic/activemq/commands/JdbcActiveMQTramCommandTestConfiguration.java b/eventuate-tram-examples-jdbc-activemq/src/test/java/io/eventuate/tram/examples/basic/activemq/commands/JdbcActiveMQTramCommandTestConfiguration.java index cbba38e..ac353c8 100644 --- a/eventuate-tram-examples-jdbc-activemq/src/test/java/io/eventuate/tram/examples/basic/activemq/commands/JdbcActiveMQTramCommandTestConfiguration.java +++ b/eventuate-tram-examples-jdbc-activemq/src/test/java/io/eventuate/tram/examples/basic/activemq/commands/JdbcActiveMQTramCommandTestConfiguration.java @@ -1,7 +1,7 @@ package io.eventuate.tram.examples.basic.activemq.commands; -import io.eventuate.jdbcactivemq.TramJdbcActiveMQConfiguration; import io.eventuate.tram.examples.basic.commands.AbstractTramCommandTestConfiguration; +import io.eventuate.tram.jdbcactivemq.TramJdbcActiveMQConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; diff --git a/eventuate-tram-examples-jdbc-activemq/src/test/java/io/eventuate/tram/examples/basic/activemq/events/JdbcActiveMQTramEventTestConfiguration.java b/eventuate-tram-examples-jdbc-activemq/src/test/java/io/eventuate/tram/examples/basic/activemq/events/JdbcActiveMQTramEventTestConfiguration.java index 0d24a62..38c1036 100644 --- a/eventuate-tram-examples-jdbc-activemq/src/test/java/io/eventuate/tram/examples/basic/activemq/events/JdbcActiveMQTramEventTestConfiguration.java +++ b/eventuate-tram-examples-jdbc-activemq/src/test/java/io/eventuate/tram/examples/basic/activemq/events/JdbcActiveMQTramEventTestConfiguration.java @@ -1,7 +1,7 @@ package io.eventuate.tram.examples.basic.activemq.events; -import io.eventuate.jdbcactivemq.TramJdbcActiveMQConfiguration; import io.eventuate.tram.examples.basic.events.AbstractTramEventTestConfiguration; +import io.eventuate.tram.jdbcactivemq.TramJdbcActiveMQConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; diff --git a/eventuate-tram-examples-jdbc-activemq/src/test/java/io/eventuate/tram/examples/basic/activemq/messages/JdbcActiveMQTramMessageTestConfiguration.java b/eventuate-tram-examples-jdbc-activemq/src/test/java/io/eventuate/tram/examples/basic/activemq/messages/JdbcActiveMQTramMessageTestConfiguration.java index 7d55e01..b416da3 100644 --- a/eventuate-tram-examples-jdbc-activemq/src/test/java/io/eventuate/tram/examples/basic/activemq/messages/JdbcActiveMQTramMessageTestConfiguration.java +++ b/eventuate-tram-examples-jdbc-activemq/src/test/java/io/eventuate/tram/examples/basic/activemq/messages/JdbcActiveMQTramMessageTestConfiguration.java @@ -1,6 +1,6 @@ package io.eventuate.tram.examples.basic.activemq.messages; -import io.eventuate.jdbcactivemq.TramJdbcActiveMQConfiguration; +import io.eventuate.tram.jdbcactivemq.TramJdbcActiveMQConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; diff --git a/eventuate-tram-examples-jdbc-rabbitmq/src/test/java/io/eventuate/tram/examples/basic/rabbitmq/commands/JdbcRabbitMQTramCommandTestConfiguration.java b/eventuate-tram-examples-jdbc-rabbitmq/src/test/java/io/eventuate/tram/examples/basic/rabbitmq/commands/JdbcRabbitMQTramCommandTestConfiguration.java index 69c2784..367ec0d 100644 --- a/eventuate-tram-examples-jdbc-rabbitmq/src/test/java/io/eventuate/tram/examples/basic/rabbitmq/commands/JdbcRabbitMQTramCommandTestConfiguration.java +++ b/eventuate-tram-examples-jdbc-rabbitmq/src/test/java/io/eventuate/tram/examples/basic/rabbitmq/commands/JdbcRabbitMQTramCommandTestConfiguration.java @@ -1,7 +1,7 @@ package io.eventuate.tram.examples.basic.rabbitmq.commands; -import io.eventuate.jdbcrabbitmq.TramJdbcRabbitMQConfiguration; import io.eventuate.tram.examples.basic.commands.AbstractTramCommandTestConfiguration; +import io.eventuate.tram.jdbcrabbitmq.TramJdbcRabbitMQConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; diff --git a/eventuate-tram-examples-jdbc-rabbitmq/src/test/java/io/eventuate/tram/examples/basic/rabbitmq/events/JdbcRabbitMQTramEventTestConfiguration.java b/eventuate-tram-examples-jdbc-rabbitmq/src/test/java/io/eventuate/tram/examples/basic/rabbitmq/events/JdbcRabbitMQTramEventTestConfiguration.java index 987cef4..23a7b13 100644 --- a/eventuate-tram-examples-jdbc-rabbitmq/src/test/java/io/eventuate/tram/examples/basic/rabbitmq/events/JdbcRabbitMQTramEventTestConfiguration.java +++ b/eventuate-tram-examples-jdbc-rabbitmq/src/test/java/io/eventuate/tram/examples/basic/rabbitmq/events/JdbcRabbitMQTramEventTestConfiguration.java @@ -1,7 +1,7 @@ package io.eventuate.tram.examples.basic.rabbitmq.events; -import io.eventuate.jdbcrabbitmq.TramJdbcRabbitMQConfiguration; import io.eventuate.tram.examples.basic.events.AbstractTramEventTestConfiguration; +import io.eventuate.tram.jdbcrabbitmq.TramJdbcRabbitMQConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; diff --git a/eventuate-tram-examples-jdbc-rabbitmq/src/test/java/io/eventuate/tram/examples/basic/rabbitmq/messages/JdbcRabbitMQTramMessageTestConfiguration.java b/eventuate-tram-examples-jdbc-rabbitmq/src/test/java/io/eventuate/tram/examples/basic/rabbitmq/messages/JdbcRabbitMQTramMessageTestConfiguration.java index 081cdbc..0132433 100644 --- a/eventuate-tram-examples-jdbc-rabbitmq/src/test/java/io/eventuate/tram/examples/basic/rabbitmq/messages/JdbcRabbitMQTramMessageTestConfiguration.java +++ b/eventuate-tram-examples-jdbc-rabbitmq/src/test/java/io/eventuate/tram/examples/basic/rabbitmq/messages/JdbcRabbitMQTramMessageTestConfiguration.java @@ -1,6 +1,6 @@ package io.eventuate.tram.examples.basic.rabbitmq.messages; -import io.eventuate.jdbcrabbitmq.TramJdbcRabbitMQConfiguration; +import io.eventuate.tram.jdbcrabbitmq.TramJdbcRabbitMQConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; diff --git a/gradle.properties b/gradle.properties index 7aff18b..b7fc5bb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,4 +7,4 @@ eventuateMavenRepoUrl=https://dl.bintray.com/eventuateio-oss/eventuate-maven-rel springBootVersion=2.1.1.RELEASE version=0.1.0-SNAPSHOT -eventuateTramVersion=0.21.2.RELEASE +eventuateTramVersion=0.21.0-SNAPSHOT diff --git a/settings.gradle b/settings.gradle index e467537..67187ae 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1,5 @@ include 'eventuate-tram-examples-common' -include 'eventuate-tram-examples-jdbc-kafka' +include 'eventuate-tram-examples-jdbc-kafka-spring' include 'eventuate-tram-examples-jdbc-rabbitmq' include 'eventuate-tram-examples-jdbc-activemq' include 'eventuate-tram-examples-in-memory'