You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Alexander Lee (JIRA)" <ji...@apache.org> on 2009/08/22 08:34:35 UTC

[jira] Created: (CAMEL-1928) FileConsumer should allow files to be processed more than once when "noop" setting is used.

FileConsumer should allow files to be processed more than once when "noop" setting is used.
-------------------------------------------------------------------------------------------

                 Key: CAMEL-1928
                 URL: https://issues.apache.org/activemq/browse/CAMEL-1928
             Project: Apache Camel
          Issue Type: Improvement
          Components: camel-core
    Affects Versions: 2.0-M3
            Reporter: Alexander Lee
            Priority: Minor


If the "noop" setting is used with the FileConsumer, then this forces use of the idempotent repository.  This means that files are only ever picked up once.  While this is probably the desired behaviour for most users, it makes it difficult to use the files to generate events on a timed basis.   For instance, a file could be used to store query configuration which was read every hour and used to query a database, the data from which would be added to an exchange and sent to the next step.  In this case we don't want to delete or move the original file and we want to read it again.

At the moment this behaviour can be simulated by using "preMove" to move the file to a new extension, and then "move" to move it back.  It would be better if there was a way to default use of the idempotent repository as is the case now, but also provide a way to explicitly turn it off if required.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CAMEL-1928) FileConsumer should allow files to be processed more than once when "noop" setting is used.

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-1928.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.0
         Assignee: Claus Ibsen

Alexander thanks for the patch. 
I have used that to implement this improvement.

trunk: 807086.

> FileConsumer should allow files to be processed more than once when "noop" setting is used.
> -------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1928
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1928
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0-M3
>            Reporter: Alexander Lee
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.1.0
>
>         Attachments: FileEndpoint.java, GenericFileEndpoint.java
>
>
> If the "noop" setting is used with the FileConsumer, then this forces use of the idempotent repository.  This means that files are only ever picked up once.  While this is probably the desired behaviour for most users, it makes it difficult to use the files to generate events on a timed basis.   For instance, a file could be used to store query configuration which was read every hour and used to query a database, the data from which would be added to an exchange and sent to the next step.  In this case we don't want to delete or move the original file and we want to read it again.
> At the moment this behaviour can be simulated by using "preMove" to move the file to a new extension, and then "move" to move it back.  It would be better if there was a way to default use of the idempotent repository as is the case now, but also provide a way to explicitly turn it off if required.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1928) FileConsumer should allow files to be processed more than once when "noop" setting is used.

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53731#action_53731 ] 

Claus Ibsen commented on CAMEL-1928:
------------------------------------

Thanks, we need an unit test as well. So if you have the time and energy please write one if possible.

> FileConsumer should allow files to be processed more than once when "noop" setting is used.
> -------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1928
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1928
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0-M3
>            Reporter: Alexander Lee
>            Priority: Minor
>         Attachments: FileEndpoint.java, GenericFileEndpoint.java
>
>
> If the "noop" setting is used with the FileConsumer, then this forces use of the idempotent repository.  This means that files are only ever picked up once.  While this is probably the desired behaviour for most users, it makes it difficult to use the files to generate events on a timed basis.   For instance, a file could be used to store query configuration which was read every hour and used to query a database, the data from which would be added to an exchange and sent to the next step.  In this case we don't want to delete or move the original file and we want to read it again.
> At the moment this behaviour can be simulated by using "preMove" to move the file to a new extension, and then "move" to move it back.  It would be better if there was a way to default use of the idempotent repository as is the case now, but also provide a way to explicitly turn it off if required.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1928) FileConsumer should allow files to be processed more than once when "noop" setting is used.

Posted by "Alexander Lee (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53726#action_53726 ] 

Alexander Lee commented on CAMEL-1928:
--------------------------------------

Hi Claus,

Sounds reasonable, though I usually prefer to be more specific/clear and would probably go with an Enum or something like that, e.g. ENABLED, DISABLED, AUTO.

Regards,
Alexander





> FileConsumer should allow files to be processed more than once when "noop" setting is used.
> -------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1928
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1928
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0-M3
>            Reporter: Alexander Lee
>            Priority: Minor
>
> If the "noop" setting is used with the FileConsumer, then this forces use of the idempotent repository.  This means that files are only ever picked up once.  While this is probably the desired behaviour for most users, it makes it difficult to use the files to generate events on a timed basis.   For instance, a file could be used to store query configuration which was read every hour and used to query a database, the data from which would be added to an exchange and sent to the next step.  In this case we don't want to delete or move the original file and we want to read it again.
> At the moment this behaviour can be simulated by using "preMove" to move the file to a new extension, and then "move" to move it back.  It would be better if there was a way to default use of the idempotent repository as is the case now, but also provide a way to explicitly turn it off if required.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1928) FileConsumer should allow files to be processed more than once when "noop" setting is used.

Posted by "Alexander Lee (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Lee updated CAMEL-1928:
---------------------------------

    Attachment: GenericFileEndpoint.java
                FileEndpoint.java

This a minimal patch to allow use of the "noop" setting without an inprogress repository.  This allows files to be picked up and processed everytime polling occurs.  This is useful where the files are basically templates or config that kicks off a regular process.

> FileConsumer should allow files to be processed more than once when "noop" setting is used.
> -------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1928
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1928
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0-M3
>            Reporter: Alexander Lee
>            Priority: Minor
>         Attachments: FileEndpoint.java, GenericFileEndpoint.java
>
>
> If the "noop" setting is used with the FileConsumer, then this forces use of the idempotent repository.  This means that files are only ever picked up once.  While this is probably the desired behaviour for most users, it makes it difficult to use the files to generate events on a timed basis.   For instance, a file could be used to store query configuration which was read every hour and used to query a database, the data from which would be added to an exchange and sent to the next step.  In this case we don't want to delete or move the original file and we want to read it again.
> At the moment this behaviour can be simulated by using "preMove" to move the file to a new extension, and then "move" to move it back.  It would be better if there was a way to default use of the idempotent repository as is the case now, but also provide a way to explicitly turn it off if required.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1928) FileConsumer should allow files to be processed more than once when "noop" setting is used.

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53732#action_53732 ] 

Claus Ibsen commented on CAMEL-1928:
------------------------------------

An enum is also very good. I wonder if we should add a generic enum for such boolean cases

{{org.apache.camel.EnabledEnum}} or what a good name would be that supports multiple names for the 3 states:
- true / ON
- false / OFF
- null / AUTO / DEFAULT


> FileConsumer should allow files to be processed more than once when "noop" setting is used.
> -------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1928
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1928
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0-M3
>            Reporter: Alexander Lee
>            Priority: Minor
>         Attachments: FileEndpoint.java, GenericFileEndpoint.java
>
>
> If the "noop" setting is used with the FileConsumer, then this forces use of the idempotent repository.  This means that files are only ever picked up once.  While this is probably the desired behaviour for most users, it makes it difficult to use the files to generate events on a timed basis.   For instance, a file could be used to store query configuration which was read every hour and used to query a database, the data from which would be added to an exchange and sent to the next step.  In this case we don't want to delete or move the original file and we want to read it again.
> At the moment this behaviour can be simulated by using "preMove" to move the file to a new extension, and then "move" to move it back.  It would be better if there was a way to default use of the idempotent repository as is the case now, but also provide a way to explicitly turn it off if required.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1928) FileConsumer should allow files to be processed more than once when "noop" setting is used.

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53721#action_53721 ] 

Claus Ibsen commented on CAMEL-1928:
------------------------------------

Alexander

Good point. However we must make sure the current behavior is preserved.

I think changing the idempotentRepository option to a java.lang.Boolean type instead of boolean and let it be null by default.
Then we have 3 states: null, TRUE, FALSE and thus can determine if null = current behavior.
If TRUE or FALSE then use it or not.

Patches is mostly welcome with unit tests :)

> FileConsumer should allow files to be processed more than once when "noop" setting is used.
> -------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1928
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1928
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0-M3
>            Reporter: Alexander Lee
>            Priority: Minor
>
> If the "noop" setting is used with the FileConsumer, then this forces use of the idempotent repository.  This means that files are only ever picked up once.  While this is probably the desired behaviour for most users, it makes it difficult to use the files to generate events on a timed basis.   For instance, a file could be used to store query configuration which was read every hour and used to query a database, the data from which would be added to an exchange and sent to the next step.  In this case we don't want to delete or move the original file and we want to read it again.
> At the moment this behaviour can be simulated by using "preMove" to move the file to a new extension, and then "move" to move it back.  It would be better if there was a way to default use of the idempotent repository as is the case now, but also provide a way to explicitly turn it off if required.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.