-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#128 Enhance PollingDao to use a thread-per-channel
Also, removed unused bean dependencies in order to simplify testing
- Loading branch information
Showing
40 changed files
with
828 additions
and
269 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: '3' | ||
services: | ||
eventuate-cdc-service: | ||
env_file: | ||
- ${DOCKER_ENV_FILE:-docker-compose-env-files/empty.env} | ||
build: | ||
context: ./eventuate-cdc-service/ | ||
image: eventuateio/eventuate-cdc-service:${DOCKER_IMAGE_TAG:-latest} | ||
ports: | ||
- "8099:8080" | ||
links: | ||
- mysql | ||
- kafka | ||
- zookeeper | ||
environment: | ||
SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate | ||
SPRING_DATASOURCE_USERNAME: mysqluser | ||
SPRING_DATASOURCE_PASSWORD: mysqlpw | ||
SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.cj.jdbc.Driver | ||
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181 | ||
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092 | ||
EVENTUATELOCAL_CDC_DB_USER_NAME: root | ||
EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword | ||
EVENTUATELOCAL_CDC_READER_NAME: MySqlReader | ||
EVENTUATE_OUTBOX_ID: 1 | ||
EVENTUATELOCAL_CDC_MYSQL_BINLOG_CLIENT_UNIQUE_ID: 1234567890 | ||
EVENTUATELOCAL_CDC_READ_OLD_DEBEZIUM_DB_OFFSET_STORAGE_TOPIC: "false" | ||
EVENTUATE_CDC_TYPE: ${EVENTUATE_CDC_TYPE} | ||
SPRING_PROFILES_ACTIVE: EventuatePolling | ||
EVENTUATELOCAL_CDC_POLLING_PARALLEL_CHANNELS: parallel_channel_1 |
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,30 @@ | ||
version: '3' | ||
services: | ||
eventuate-cdc-service: | ||
build: ./eventuate-cdc-service | ||
ports: | ||
- "8099:8080" | ||
links: | ||
- mysql | ||
- kafka | ||
- zookeeper | ||
environment: | ||
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092 | ||
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181 | ||
SPRING_PROFILES_ACTIVE: ${SPRING_PROFILES_ACTIVE} | ||
|
||
EVENTUATE_CDC_READER_MYSQLREADER_TYPE: polling | ||
EVENTUATE_CDC_READER_MYSQLREADER_DATASOURCEURL: jdbc:mysql://mysql:3306/eventuate | ||
EVENTUATE_CDC_READER_MYSQLREADER_DATASOURCEUSERNAME: mysqluser | ||
EVENTUATE_CDC_READER_MYSQLREADER_DATASOURCEPASSWORD: mysqlpw | ||
EVENTUATE_CDC_READER_MYSQLREADER_DATASOURCEDRIVERCLASSNAME: com.mysql.cj.jdbc.Driver | ||
EVENTUATE_CDC_READER_MYSQLREADER_LEADERSHIPLOCKPATH: /eventuatelocal/cdc/leader/pipeline/1 | ||
EVENTUATE_CDC_READER_MYSQLREADER_OUTBOXID: 1 | ||
EVENTUATE_CDC_READER_MYSQLREADER_POLLINGPARALLELCHANNELNAMES: parallel_channel_1 | ||
|
||
EVENTUATE_CDC_PIPELINE_P1_TYPE: eventuate-local | ||
EVENTUATE_CDC_PIPELINE_P1_READER: MYSQLREADER | ||
|
||
EVENTUATE_CDC_PIPELINE_P4_TYPE: eventuate-tram | ||
EVENTUATE_CDC_PIPELINE_P4_READER: MYSQLREADER | ||
|
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
41 changes: 41 additions & 0 deletions
41
...c-connector-polling/src/main/java/io/eventuate/local/polling/ParallelPollingChannels.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,41 @@ | ||
package io.eventuate.local.polling; | ||
|
||
import io.eventuate.local.polling.spec.PollingSpec; | ||
|
||
import java.util.Arrays; | ||
import java.util.HashSet; | ||
import java.util.List; | ||
import java.util.Set; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.Stream; | ||
|
||
import static java.util.Collections.singletonList; | ||
|
||
public class ParallelPollingChannels { | ||
|
||
private Set<String> channels; | ||
|
||
@Override | ||
public String toString() { | ||
return "ParallelPollingChannels{" + | ||
"channels=" + channels + | ||
'}'; | ||
} | ||
|
||
public ParallelPollingChannels(Set<String> channels) { | ||
this.channels = channels; | ||
} | ||
|
||
public static ParallelPollingChannels make(String[] channels) { | ||
return new ParallelPollingChannels(new HashSet<>(Arrays.asList(channels))); | ||
} | ||
|
||
public int size() { | ||
return channels.size(); | ||
} | ||
|
||
public List<PollingSpec> makePollingSpecs() { | ||
return channels.isEmpty() ? singletonList(PollingSpec.ALL) : Stream.concat(Stream.of(PollingSpec.excludingChannels(channels)), channels.stream().map(PollingSpec::forChannel)).collect(Collectors.toList()); | ||
} | ||
|
||
} |
Oops, something went wrong.