Bug fixes to testing architecture

This commit is contained in:
Meher Mankikar 2023-06-14 14:18:01 -07:00
parent 37f6c042f4
commit 67ebab7c9f
2 changed files with 14 additions and 6 deletions

View file

@ -140,11 +140,8 @@ public interface KCLAppConfig {
} }
default ConfigsBuilder getConfigsBuilder() throws IOException, URISyntaxException { default ConfigsBuilder getConfigsBuilder() throws IOException, URISyntaxException {
return getConfigsBuilder(""); // return getConfigsBuilder("");
} final String workerId = getWorkerId();
default ConfigsBuilder getConfigsBuilder(String workerIdSuffix) throws IOException, URISyntaxException {
final String workerId = getWorkerId() + workerIdSuffix;
if (getStreamArn() == null) { if (getStreamArn() == null) {
return new ConfigsBuilder(getStreamName(), getApplicationName(), buildConsumerClient(), buildAsyncDynamoDbClient(), return new ConfigsBuilder(getStreamName(), getApplicationName(), buildConsumerClient(), buildAsyncDynamoDbClient(),
buildAsyncCloudWatchClient(), workerId, getShardRecordProcessorFactory()); buildAsyncCloudWatchClient(), workerId, getShardRecordProcessorFactory());
@ -154,6 +151,17 @@ public interface KCLAppConfig {
} }
} }
// default ConfigsBuilder getConfigsBuilder(String workerIdSuffix) throws IOException, URISyntaxException {
// final String workerId = getWorkerId() + workerIdSuffix;
// if (getStreamArn() == null) {
// return new ConfigsBuilder(getStreamName(), getApplicationName(), buildConsumerClient(), buildAsyncDynamoDbClient(),
// buildAsyncCloudWatchClient(), workerId, getShardRecordProcessorFactory());
// } else {
// return new ConfigsBuilder(Arn.fromString(getStreamArn()), getApplicationName(), buildConsumerClient(), buildAsyncDynamoDbClient(),
// buildAsyncCloudWatchClient(), workerId, getShardRecordProcessorFactory());
// }
// }
RetrievalConfig getRetrievalConfig() throws IOException, URISyntaxException; RetrievalConfig getRetrievalConfig() throws IOException, URISyntaxException;
/** /**

View file

@ -124,7 +124,7 @@ public class TestConsumer {
* Stops sending dummy data. * Stops sending dummy data.
*/ */
log.info("Cancelling producer and shutting down executor."); log.info("Cancelling producer and shutting down executor.");
producerFuture.cancel(true); producerFuture.cancel(false);
producerExecutor.shutdownNow(); producerExecutor.shutdownNow();
/** /**