Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0AF1618C06 for ; Wed, 28 Oct 2015 10:45:28 +0000 (UTC) Received: (qmail 26605 invoked by uid 500); 28 Oct 2015 10:45:28 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 26549 invoked by uid 500); 28 Oct 2015 10:45:27 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 26529 invoked by uid 99); 28 Oct 2015 10:45:27 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Oct 2015 10:45:27 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C4F192C1F58 for ; Wed, 28 Oct 2015 10:45:27 +0000 (UTC) Date: Wed, 28 Oct 2015 10:45:27 +0000 (UTC) From: "James Lindstorff (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CAMEL-8539) S3 marker does not work MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-8539?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] James Lindstorff updated CAMEL-8539: ------------------------------------ Attachment: 8539.patch Attached is a patch that uses isTruncated to detect the end of the object listing. Note that using the consumer with deleteAfterRead=false only read the files once so the consumer will never detect new files in the bucket. > S3 marker does not work > ----------------------- > > Key: CAMEL-8539 > URL: https://issues.apache.org/jira/browse/CAMEL-8539 > Project: Camel > Issue Type: Bug > Components: camel-aws > Affects Versions: 2.15.0 > Reporter: Alexey Hanin > Attachments: 8539.patch > > > S3Consumer doesn't set marker correctly, when {{deleteAfterRead}} is set to {{false}}. Therefore, on every subsequent poll, it starts from the beginning of the list. > The reason for that is the following code in S3Consumer: > {code:lang=java|title=S3Consumer.java} > if (!getConfiguration().isDeleteAfterRead()) { > // where marker is track > marker = listObjects.getMarker(); > } > {code} > Accordingly to S3 client documentation, {{getMarker()}} return a marker previously set in request. Instead, {{getNextMarker()}} shall be used. Although, simply changing it to use {{getNextMarker()}} introduces an endless loop iterating over the same set of keys under the prefix, because when reached the end of the key set, {{getNextMarker()}} returns {{null}}, and on the next poll, the head of the list will be returned, and so on. -- This message was sent by Atlassian JIRA (v6.3.4#6332)