-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decoupled MessageConsumer from JDBC - using the SQL-based duplicate d…
…etector is now optional
- Loading branch information
Showing
27 changed files
with
107 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,13 @@ | ||
apply plugin: PublicModulePlugin | ||
|
||
dependencies { | ||
compile project(":eventuate-tram-jdbc") | ||
// compile project(":eventuate-tram-jdbc") | ||
compile project(":eventuate-tram-messaging") | ||
compile project(":eventuate-tram-messaging-jdbc") | ||
|
||
compile "io.eventuate.local.java:eventuate-local-java-common:$eventuateLocalVersion" | ||
compile "org.springframework.boot:spring-boot-starter-jdbc:$springBootVersion" | ||
compile 'mysql:mysql-connector-java:5.1.36' | ||
compile ('org.postgresql:postgresql:9.4-1200-jdbc41') { | ||
exclude group: "org.slf4j", module: "slf4j-simple" | ||
} | ||
|
||
compile "io.eventuate.client.java:eventuate-client-java-common-impl:$eventuateClientVersion" | ||
compile "io.eventuate.client.java:eventuate-client-java-jdbc-common:$eventuateClientVersion" | ||
// compile "io.eventuate.client.java:eventuate-client-java-jdbc-common:$eventuateClientVersion" | ||
} | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...-common/src/main/java/io/eventuate/tram/consumer/common/NoopDuplicateMessageDetector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
...mmon/src/main/java/io/eventuate/tram/consumer/common/TramConsumerCommonConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...java/io/eventuate/tram/consumer/common/TramNoopDuplicateMessageDetectorConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.eventuate.tram.consumer.common; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class TramNoopDuplicateMessageDetectorConfiguration { | ||
|
||
@Bean | ||
public DuplicateMessageDetector duplicateMessageDetector() { | ||
return new NoopDuplicateMessageDetector(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
|
||
dependencies { | ||
compile project(":eventuate-tram-consumer-common") | ||
compile project(":eventuate-tram-messaging-jdbc") | ||
|
||
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootCdcVersion" | ||
|
||
} |
4 changes: 3 additions & 1 deletion
4
...qlTableBasedDuplicateMessageDetector.java → ...qlTableBasedDuplicateMessageDetector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...mer-jdbc/src/main/java/io/eventuate/tram/consumer/jdbc/TramConsumerJdbcConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.eventuate.tram.consumer.jdbc; | ||
|
||
import io.eventuate.javaclient.spring.jdbc.EventuateSchema; | ||
import io.eventuate.tram.consumer.common.DuplicateMessageDetector; | ||
import io.eventuate.tram.jdbc.CommonJdbcMessagingConfiguration; | ||
import io.eventuate.tram.messaging.common.sql.SqlDialectConfiguration; | ||
import io.eventuate.tram.messaging.common.sql.SqlDialectSelector; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Import; | ||
import org.springframework.transaction.support.TransactionTemplate; | ||
|
||
@Configuration | ||
@Import({SqlDialectConfiguration.class, CommonJdbcMessagingConfiguration.class}) | ||
public class TramConsumerJdbcConfiguration { | ||
|
||
@Bean | ||
@ConditionalOnMissingBean(DuplicateMessageDetector.class) | ||
public DuplicateMessageDetector duplicateMessageDetector(EventuateSchema eventuateSchema, | ||
SqlDialectSelector sqlDialectSelector, TransactionTemplate transactionTemplate) { | ||
return new SqlTableBasedDuplicateMessageDetector(eventuateSchema, | ||
sqlDialectSelector.getDialect().getCurrentTimeInMillisecondsExpression(), transactionTemplate); | ||
} | ||
|
||
} |
15 changes: 12 additions & 3 deletions
15
...r/kafka/DuplicateMessageDetectorTest.java → ...bleBasedDuplicateMessageDetectorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
...test/java/io/eventuate/tram/consumer/kafka/DuplicateMessageDetectorTestConfiguration.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...ava/io/eventuate/tram/e2e/tests/redis/messages/JdbcRedisTramMessageTestConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
package io.eventuate.tram.e2e.tests.redis.messages; | ||
|
||
import io.eventuate.jdbcredis.TramJdbcRedisConfiguration; | ||
import io.eventuate.tram.consumer.common.NoopDuplicateMessageDetector; | ||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Import; | ||
|
||
@Configuration | ||
@EnableAutoConfiguration | ||
@Import({TramJdbcRedisConfiguration.class}) | ||
@Import({TramJdbcRedisConfiguration.class, NoopDuplicateMessageDetector.class}) | ||
public class JdbcRedisTramMessageTestConfiguration { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...-jdbc-activemq/src/main/java/io/eventuate/jdbcactivemq/TramJdbcActiveMQConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
package io.eventuate.jdbcactivemq; | ||
|
||
import io.eventuate.tram.consumer.activemq.TramConsumerActiveMQConfiguration; | ||
import io.eventuate.tram.consumer.jdbc.TramConsumerJdbcConfiguration; | ||
import io.eventuate.tram.messaging.producer.jdbc.TramMessageProducerJdbcConfiguration; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Import; | ||
|
||
@Configuration | ||
@Import({TramConsumerActiveMQConfiguration.class, TramMessageProducerJdbcConfiguration.class, }) | ||
@Import({TramConsumerActiveMQConfiguration.class, TramMessageProducerJdbcConfiguration.class, TramConsumerJdbcConfiguration.class}) | ||
public class TramJdbcActiveMQConfiguration { | ||
} |
3 changes: 2 additions & 1 deletion
3
...uate-tram-jdbc-kafka/src/main/java/io/eventuate/jdbckafka/TramJdbcKafkaConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
package io.eventuate.jdbckafka; | ||
|
||
import io.eventuate.tram.consumer.jdbc.TramConsumerJdbcConfiguration; | ||
import io.eventuate.tram.consumer.kafka.TramConsumerKafkaConfiguration; | ||
import io.eventuate.tram.messaging.producer.jdbc.TramMessageProducerJdbcConfiguration; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Import; | ||
|
||
@Configuration | ||
@Import({TramConsumerKafkaConfiguration.class, TramMessageProducerJdbcConfiguration.class, }) | ||
@Import({TramConsumerKafkaConfiguration.class, TramMessageProducerJdbcConfiguration.class, TramConsumerJdbcConfiguration.class}) | ||
public class TramJdbcKafkaConfiguration { | ||
} |
3 changes: 2 additions & 1 deletion
3
...-jdbc-rabbitmq/src/main/java/io/eventuate/jdbcrabbitmq/TramJdbcRabbitMQConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
package io.eventuate.jdbcrabbitmq; | ||
|
||
import io.eventuate.tram.consumer.jdbc.TramConsumerJdbcConfiguration; | ||
import io.eventuate.tram.consumer.rabbitmq.TramConsumerRabbitMQConfiguration; | ||
import io.eventuate.tram.messaging.producer.jdbc.TramMessageProducerJdbcConfiguration; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Import; | ||
|
||
@Configuration | ||
@Import({TramConsumerRabbitMQConfiguration.class, TramMessageProducerJdbcConfiguration.class}) | ||
@Import({TramConsumerRabbitMQConfiguration.class, TramMessageProducerJdbcConfiguration.class, TramConsumerJdbcConfiguration.class}) | ||
public class TramJdbcRabbitMQConfiguration { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...uate-tram-jdbc-redis/src/main/java/io/eventuate/jdbcredis/TramJdbcRedisConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
package io.eventuate.jdbcredis; | ||
|
||
import io.eventuate.tram.consumer.jdbc.TramConsumerJdbcConfiguration; | ||
import io.eventuate.tram.consumer.redis.TramConsumerRedisConfiguration; | ||
import io.eventuate.tram.messaging.producer.jdbc.TramMessageProducerJdbcConfiguration; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Import; | ||
|
||
@Configuration | ||
@Import({TramConsumerRedisConfiguration.class, TramMessageProducerJdbcConfiguration.class}) | ||
@Import({TramConsumerRedisConfiguration.class, TramMessageProducerJdbcConfiguration.class, TramConsumerJdbcConfiguration.class}) | ||
public class TramJdbcRedisConfiguration { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...ng-jdbc/src/main/java/io/eventuate/tram/messaging/common/sql/SqlDialectConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters