[
https://issues.apache.org/jira/browse/CAMEL-12367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16405967#comment-16405967
]
Claus Ibsen commented on CAMEL-12367:
-------------------------------------
So yeah you are on-to-something as the solution for this pollEnrich issue for
the reporter is to reduce the cache size / turn it off.
That would be needed regardless if there is a S3PollingConsumer or not. The
latter is just a bit better way to poll a single file on-demand.
So I think we should create a new ticket about a new S3PollingConsumer (and
potentially a few other in the camel-aws) as the AWS component is much in use,
and could benefit from this. Implementing S3PollingConsumer is a bit "more
hard" to do. You can look at the GenericFilePollingConsumer and how it was
implemented in the file component. As there is a bit of code to implement we
may ponder about having a base class they can extend for more code-reuse.
> camel-aws - aws-s3 - Thread leak in pollEnrich with dynamic uri
> ---------------------------------------------------------------
>
> Key: CAMEL-12367
> URL: https://issues.apache.org/jira/browse/CAMEL-12367
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Affects Versions: 2.19.2
> Reporter: Damien B
> Assignee: Andrea Cosentino
> Priority: Major
> Fix For: 2.22.0
>
>
> In a route we have this snippet:
> {code:java}
> <pollEnrich>
>
> <simple>aws-s3://{{AWS_BUCKET_NAME_DOWNLOAD}}?amazonS3Client=#amazonS3Client&deleteAfterRead=false&prefix=${body.key}</simple>
> </pollEnrich>{code}
> This is used to download one specific file from a bucket. Every time this is
> called, the endpoint URI changes because ${body.key} is constantly changing.
>
> In ScheduledPollConsumer we have this:
> {code:java}
> public long beforePoll(long timeout) throws Exception {
> if (!ServiceHelper.resumeService(this)) {
> ServiceHelper.startService(this);
> }
> return Math.max(timeout, getDelay());
> }
> public void afterPoll() throws Exception {
> if (!ServiceHelper.suspendService(this)) {
> ServiceHelper.stopService(this);
> }
> }
> {code}
>
> Since S3Consumer is a Suspendable, the thread created by
> ServiceHelper.startService is never going to be killed, and since it's never
> going to be reused because we'll never have twice the same endpoint URI,
> eventually the application dies because of the rogue threads.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)