Closed joelittlejohn closed 4 years ago
Anyone have any comment on this?
/cc @pfifer @amcp :)
any update on this question?
Yes, AmazonDynamoDBStreamsAdapterClient
is thread safe. It is accessed concurrently by ProcessTask
instances inside the KCL worker. There are only two instance variables in the class: internalClient
and requestCache
. The variable internalClient
is an AWS SDK client, which is thread safe. The second variable requestCache
holds a reference to a plain HashMap
, but mutating methods use the synchronized
keyword.
I have an application that consumes multiple DynamoDB streams from different tables. I'd like to reuse stateless clients where I can.
Is it acceptable to create different KCL workers that use the same AmazonDynamoDBStreamsAdapterClient instance, where each worker is consuming a different table stream?