-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#181 Implement message table 'sharding' - enable configuration of Mes…
…sageProducerJdbcImpl to write to sharded outbox table.
- Loading branch information
Showing
14 changed files
with
147 additions
and
5 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
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
19 changes: 19 additions & 0 deletions
19
...est/src/test/java/io/eventuate/tram/broker/db/integrationtests/EventuateCdcContainer.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,19 @@ | ||
package io.eventuate.tram.broker.db.integrationtests; | ||
|
||
import io.eventuate.common.testcontainers.PropertyProvidingContainer; | ||
import org.testcontainers.containers.GenericContainer; | ||
|
||
import java.util.function.BiConsumer; | ||
import java.util.function.Supplier; | ||
|
||
public class EventuateCdcContainer extends GenericContainer<EventuateCdcContainer> implements PropertyProvidingContainer { | ||
|
||
public EventuateCdcContainer() { | ||
super("eventuateio/eventuate-cdc-service:0.14.0-SNAPSHOT"); | ||
} | ||
|
||
@Override | ||
public void registerProperties(BiConsumer<String, Supplier<Object>> registry) { | ||
|
||
} | ||
} |
77 changes: 77 additions & 0 deletions
77
.../java/io/eventuate/tram/broker/db/integrationtests/MultipleOutboxTramIntegrationTest.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,77 @@ | ||
package io.eventuate.tram.broker.db.integrationtests; | ||
|
||
import io.eventuate.common.testcontainers.EventuateMySqlContainer; | ||
import io.eventuate.common.testcontainers.EventuateZookeeperContainer; | ||
import io.eventuate.common.testcontainers.PropertyProvidingContainer; | ||
import io.eventuate.messaging.kafka.testcontainers.EventuateKafkaContainer; | ||
import org.junit.runner.RunWith; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.DynamicPropertyRegistry; | ||
import org.springframework.test.context.DynamicPropertySource; | ||
import org.springframework.test.context.junit4.SpringRunner; | ||
import org.testcontainers.containers.Network; | ||
import org.testcontainers.containers.wait.strategy.DockerHealthcheckWaitStrategy; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
|
||
@RunWith(SpringRunner.class) | ||
@SpringBootTest(classes = TramIntegrationTestConfiguration.class, properties = {"eventuate.tram.outbox.partitioning.outbox.tables=8", "eventuate.tram.outbox.partitioning.message.partitions=4"}) | ||
public class MultipleOutboxTramIntegrationTest extends AbstractTramIntegrationTest { | ||
|
||
public static final int OUTBOX_TABLES = 8; | ||
public static Network network = Network.newNetwork(); | ||
public static EventuateMySqlContainer mysql = | ||
new EventuateMySqlContainer() | ||
.withNetwork(network) | ||
.withNetworkAliases("mysql") | ||
.withEnv("EVENTUATE_OUTBOX_TABLES", Integer.toString(OUTBOX_TABLES)) | ||
.withReuse(true); | ||
|
||
|
||
public static EventuateZookeeperContainer zookeeper = new EventuateZookeeperContainer().withReuse(true) | ||
.withNetwork(network) | ||
.withNetworkAliases("zookeeper"); | ||
|
||
public static EventuateKafkaContainer kafka = | ||
new EventuateKafkaContainer("zookeeper:2181") | ||
.waitingFor(new DockerHealthcheckWaitStrategy()) | ||
.withNetwork(network) | ||
.withNetworkAliases("kafka") | ||
.withReuse(true); | ||
|
||
public static EventuateCdcContainer cdc = | ||
new EventuateCdcContainer() | ||
.withNetwork(network) | ||
.withEnv("SPRING_DATASOURCE_URL", "jdbc:mysql://mysql/eventuate") | ||
.withEnv("SPRING_DATASOURCE_USERNAME", "mysqluser") | ||
.withEnv("SPRING_DATASOURCE_PASSWORD", "mysqlpw") | ||
.withEnv("SPRING_DATASOURCE_DRIVER_CLASS_NAME", "com.mysql.cj.jdbc.Driver") | ||
.withEnv("EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING", "zookeeper:2181") | ||
.withEnv("EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS", "kafka:29092") | ||
.withEnv("EVENTUATELOCAL_CDC_DB_USER_NAME", "root") | ||
.withEnv("EVENTUATELOCAL_CDC_DB_PASSWORD", "rootpassword") | ||
.withEnv("EVENTUATELOCAL_CDC_READER_NAME", "MySqlReader") | ||
.withEnv("EVENTUATE_OUTBOX_ID", "1") | ||
.withEnv("EVENTUATELOCAL_CDC_MYSQL_BINLOG_CLIENT_UNIQUE_ID", "1234567890") | ||
.withEnv("EVENTUATELOCAL_CDC_READ_OLD_DEBEZIUM_DB_OFFSET_STORAGE_TOPIC", "false") | ||
.withEnv("SPRING_PROFILES_ACTIVE", "EventuatePolling") | ||
.withEnv("EVENTUATE_CDC_OUTBOX_PARTITIONING_OUTBOX_TABLES", Integer.toString(OUTBOX_TABLES)) | ||
|
||
; | ||
|
||
@DynamicPropertySource | ||
static void registerMySqlProperties(DynamicPropertyRegistry registry) { | ||
PropertyProvidingContainer.startAndProvideProperties(registry, mysql, zookeeper, kafka, cdc); | ||
} | ||
|
||
|
||
@Override | ||
protected void preAssertCheck() { | ||
try { | ||
TimeUnit.SECONDS.sleep(15); | ||
} catch (InterruptedException e) { | ||
throw new RuntimeException(e); | ||
} | ||
System.out.println(cdc.getLogs()); | ||
} | ||
} |
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
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