Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backwards-incompatible change in 1.6.0 causes NullPointerException #57

Open
staktrace opened this issue Nov 6, 2023 · 1 comment
Open

Comments

@staktrace
Copy link

Hi, we have some code that invokes StreamsWorkerFactory.createDynamoDbStreamsWorker like so:

StreamsWorkerFactory.createDynamoDbStreamsWorker(
      /* recordProcessorFactory = */
      transactionAuthRequestsStreamsRecordProcessorFactory,
      /* config = */
      kinesisClientLibConfiguration,
      /* streamsClient = */
      amazonDynamoDBStreamsAdapterClient,
      /* dynamoDBClient = */
      dynamoDBClient,
      /* cloudWatchClient = */
      null
)

In version 1.5.3 of this lib, this worked fine. In 1.6.0 it throws an NullPointerException with this at the top of the stack:

java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "cloudWatchClient" is null
	at com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker.getMetricsFactory(Worker.java:1241)
	at com.amazonaws.services.dynamodbv2.streamsadapter.StreamsWorkerFactory.createDynamoDbStreamsWorker(StreamsWorkerFactory.java:127)

It appears that passing a null cloudWatchClient is no longer allowed, is this intentional?

@staktrace
Copy link
Author

staktrace commented Nov 6, 2023

https://github.com/awslabs/amazon-kinesis-client/blob/1.14.9/src/main/java/com/amazonaws/services/kinesis/clientlibrary/lib/worker/Worker.java#L1241 is the line that is generating the exception (I believe), but this lib wasn't calling that code in 1.5.3 and does call it in 1.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant