[ 
https://issues.apache.org/jira/browse/CAMEL-27942?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-27942:
--------------------------------
    Description: 
Found while improving the option descriptions of camel-aws2-kinesis for 
CAMEL-23832 (commit 
https://github.com/apache/camel/commit/d5a852f1554249665c55be65e7b60727f2348b3f,
 pull request https://github.com/apache/camel/pull/31191).
These are separate problems of the component; the descriptions change only 
documents the current behavior.

h4. 1. An unused sync client is built at startup
{{Kinesis2Endpoint.doStart}} builds a sync KinesisClient from the options also 
when asyncClient=true with amazonKinesisAsyncClient set, or with 
useKclConsumers=true without asyncClient; with no region and no default region 
the build fails and the endpoint does not start.
Proposed change: create the sync client only when the producer or the polling 
consumer without asyncClient needs it.

h4. 2. KCL consumer without an async client reads nothing
{{KclKinesis2Consumer.doStart}}: with useKclConsumers=true but neither 
asyncClient=true nor amazonKinesisAsyncClient, the async client is null, 
ConfigsBuilder throws a NullPointerException inside KclKinesisConsumingTask, 
the handler only logs a WARN, and the route starts and reads nothing.
Proposed change: fail in doStart with a clear message, or create the async 
client from the options.

h4. 3. KCL DynamoDB and CloudWatch clients
{{KclKinesis2Consumer.doStart}} creates DynamoDB and CloudWatch clients that 
are never closed; they ignore useDefaultCredentialsProvider, 
useProfileCredentialsProvider and useSessionCredentials, and the proxy, 
uriEndpointOverride and trustAllCertificates options.
Proposed change: build them with AwsClientBuilderUtil and close them in doStop 
when the consumer created them.

h4. 4. CamelMessageTimestamp loses the milliseconds
{{Kinesis2Consumer}} and {{KclKinesis2Consumer}} createExchange set it to 
getEpochSecond()*1000.
Proposed change: use toEpochMilli().

h4. 5. Smaller issues
When two endpoints use cborEnabled=false, the first one to stop clears the 
global aws.cborEnabled property. The iteratorType enum lists "null" 
(UNKNOWN_TO_SDK_VERSION). CamelAwsKinesisApproximateArrivalTimestamp has 
javaType String but is an Instant. Firehose: 
CamelAwsKinesisFirehoseDeliveryStreamArn is labelled createDeliveryStream but 
describeDeliveryStream sets it too; useDefaultCredentialsProvider is labelled 
common (security in aws2-kinesis); sendBatchRecord casts an Iterable body to 
Collection. The doc page says a KinesisClient must be in the registry and 
points to SDK v1 credential classes.


_Claude Code on behalf of davsclaus_

  was:
Found while improving the option descriptions of camel-aws2-kinesis for 
CAMEL-23832 (pull request https://github.com/apache/camel/pull/31191).
These are separate problems of the component; the descriptions change only 
documents the current behavior.

h4. 1. An unused sync client is built at startup
{{Kinesis2Endpoint.doStart}} builds a sync KinesisClient from the options also 
when asyncClient=true with amazonKinesisAsyncClient set, or with 
useKclConsumers=true without asyncClient; with no region and no default region 
the build fails and the endpoint does not start.
Proposed change: create the sync client only when the producer or the polling 
consumer without asyncClient needs it.

h4. 2. KCL consumer without an async client reads nothing
{{KclKinesis2Consumer.doStart}}: with useKclConsumers=true but neither 
asyncClient=true nor amazonKinesisAsyncClient, the async client is null, 
ConfigsBuilder throws a NullPointerException inside KclKinesisConsumingTask, 
the handler only logs a WARN, and the route starts and reads nothing.
Proposed change: fail in doStart with a clear message, or create the async 
client from the options.

h4. 3. KCL DynamoDB and CloudWatch clients
{{KclKinesis2Consumer.doStart}} creates DynamoDB and CloudWatch clients that 
are never closed; they ignore useDefaultCredentialsProvider, 
useProfileCredentialsProvider and useSessionCredentials, and the proxy, 
uriEndpointOverride and trustAllCertificates options.
Proposed change: build them with AwsClientBuilderUtil and close them in doStop 
when the consumer created them.

h4. 4. CamelMessageTimestamp loses the milliseconds
{{Kinesis2Consumer}} and {{KclKinesis2Consumer}} createExchange set it to 
getEpochSecond()*1000.
Proposed change: use toEpochMilli().

h4. 5. Smaller issues
When two endpoints use cborEnabled=false, the first one to stop clears the 
global aws.cborEnabled property. The iteratorType enum lists "null" 
(UNKNOWN_TO_SDK_VERSION). CamelAwsKinesisApproximateArrivalTimestamp has 
javaType String but is an Instant. Firehose: 
CamelAwsKinesisFirehoseDeliveryStreamArn is labelled createDeliveryStream but 
describeDeliveryStream sets it too; useDefaultCredentialsProvider is labelled 
common (security in aws2-kinesis); sendBatchRecord casts an Iterable body to 
Collection. The doc page says a KinesisClient must be in the registry and 
points to SDK v1 credential classes.


_Claude Code on behalf of davsclaus_


> camel-aws2-kinesis: unused sync client stops startup, KCL consumer without 
> async client reads nothing, timestamp loses milliseconds
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-27942
>                 URL: https://issues.apache.org/jira/browse/CAMEL-27942
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-aws2-kinesis
>            Reporter: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.25.0
>
>
> Found while improving the option descriptions of camel-aws2-kinesis for 
> CAMEL-23832 (commit 
> https://github.com/apache/camel/commit/d5a852f1554249665c55be65e7b60727f2348b3f,
>  pull request https://github.com/apache/camel/pull/31191).
> These are separate problems of the component; the descriptions change only 
> documents the current behavior.
> h4. 1. An unused sync client is built at startup
> {{Kinesis2Endpoint.doStart}} builds a sync KinesisClient from the options 
> also when asyncClient=true with amazonKinesisAsyncClient set, or with 
> useKclConsumers=true without asyncClient; with no region and no default 
> region the build fails and the endpoint does not start.
> Proposed change: create the sync client only when the producer or the polling 
> consumer without asyncClient needs it.
> h4. 2. KCL consumer without an async client reads nothing
> {{KclKinesis2Consumer.doStart}}: with useKclConsumers=true but neither 
> asyncClient=true nor amazonKinesisAsyncClient, the async client is null, 
> ConfigsBuilder throws a NullPointerException inside KclKinesisConsumingTask, 
> the handler only logs a WARN, and the route starts and reads nothing.
> Proposed change: fail in doStart with a clear message, or create the async 
> client from the options.
> h4. 3. KCL DynamoDB and CloudWatch clients
> {{KclKinesis2Consumer.doStart}} creates DynamoDB and CloudWatch clients that 
> are never closed; they ignore useDefaultCredentialsProvider, 
> useProfileCredentialsProvider and useSessionCredentials, and the proxy, 
> uriEndpointOverride and trustAllCertificates options.
> Proposed change: build them with AwsClientBuilderUtil and close them in 
> doStop when the consumer created them.
> h4. 4. CamelMessageTimestamp loses the milliseconds
> {{Kinesis2Consumer}} and {{KclKinesis2Consumer}} createExchange set it to 
> getEpochSecond()*1000.
> Proposed change: use toEpochMilli().
> h4. 5. Smaller issues
> When two endpoints use cborEnabled=false, the first one to stop clears the 
> global aws.cborEnabled property. The iteratorType enum lists "null" 
> (UNKNOWN_TO_SDK_VERSION). CamelAwsKinesisApproximateArrivalTimestamp has 
> javaType String but is an Instant. Firehose: 
> CamelAwsKinesisFirehoseDeliveryStreamArn is labelled createDeliveryStream but 
> describeDeliveryStream sets it too; useDefaultCredentialsProvider is labelled 
> common (security in aws2-kinesis); sendBatchRecord casts an Iterable body to 
> Collection. The doc page says a KinesisClient must be in the registry and 
> points to SDK v1 credential classes.
> _Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to