[jira] Created: (CAMEL-1237) Adds file and url support to stream endpoint. Allows a text file to be polled for continual updates.

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (CAMEL-1237) Adds file and url support to stream endpoint. Allows a text file to be polled for continual updates.

JIRA jira@apache.org
Adds file and url support to stream endpoint. Allows a text file to be polled for continual updates.
----------------------------------------------------------------------------------------------------

                 Key: CAMEL-1237
                 URL: https://issues.apache.org/activemq/browse/CAMEL-1237
             Project: Apache Camel
          Issue Type: Improvement
          Components: camel-stream
         Environment: All
            Reporter: Stephen Joyner
            Priority: Minor
             Fix For: 2.0.0


The camel-stream component is documented to support file and url parameters, but the code in the StreamEnpoint.java file didn't allow these properties to be set. This patch also adds the feature of keeping a text file open and reading lines from it as they are written by other processes or applications.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CAMEL-1237) Adds file and url support to stream endpoint. Allows a text file to be polled for continual updates.

JIRA jira@apache.org

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

Stephen Joyner updated CAMEL-1237:
----------------------------------

    Attachment: StreamEndpoint_patch.txt
                StreamConsumer_patch.txt

Patch to implement improvements described in issue.

> Adds file and url support to stream endpoint. Allows a text file to be polled for continual updates.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1237
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1237
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-stream
>         Environment: All
>            Reporter: Stephen Joyner
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: StreamConsumer_patch.txt, StreamEndpoint_patch.txt
>
>
> The camel-stream component is documented to support file and url parameters, but the code in the StreamEnpoint.java file didn't allow these properties to be set. This patch also adds the feature of keeping a text file open and reading lines from it as they are written by other processes or applications.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CAMEL-1237) Adds file and url support to stream endpoint. Allows a text file to be polled for continual updates.

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Stephen Joyner updated CAMEL-1237:
----------------------------------

    Attachment:     (was: StreamConsumer_patch.txt)

> Adds file and url support to stream endpoint. Allows a text file to be polled for continual updates.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1237
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1237
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-stream
>         Environment: All
>            Reporter: Stephen Joyner
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: StreamConsumer_multThread.txt, StreamEndpoint_patch.txt
>
>
> The camel-stream component is documented to support file and url parameters, but the code in the StreamEnpoint.java file didn't allow these properties to be set. This patch also adds the feature of keeping a text file open and reading lines from it as they are written by other processes or applications.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CAMEL-1237) Adds file and url support to stream endpoint. Allows a text file to be polled for continual updates.

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Stephen Joyner updated CAMEL-1237:
----------------------------------

    Attachment: StreamConsumer_multThread.txt

The StreamConsumer.java needs to be spin off it's own thread when started if the scan file feature is used, because it will block the main thread from processing additional routes.

> Adds file and url support to stream endpoint. Allows a text file to be polled for continual updates.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1237
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1237
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-stream
>         Environment: All
>            Reporter: Stephen Joyner
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: StreamConsumer_multThread.txt, StreamEndpoint_patch.txt
>
>
> The camel-stream component is documented to support file and url parameters, but the code in the StreamEnpoint.java file didn't allow these properties to be set. This patch also adds the feature of keeping a text file open and reading lines from it as they are written by other processes or applications.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Assigned: (CAMEL-1237) Adds file and url support to stream endpoint. Allows a text file to be polled for continual updates.

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Claus Ibsen reassigned CAMEL-1237:
----------------------------------

    Assignee: Claus Ibsen

> Adds file and url support to stream endpoint. Allows a text file to be polled for continual updates.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1237
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1237
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-stream
>         Environment: All
>            Reporter: Stephen Joyner
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: StreamConsumer_multThread.txt, StreamEndpoint_patch.txt
>
>
> The camel-stream component is documented to support file and url parameters, but the code in the StreamEnpoint.java file didn't allow these properties to be set. This patch also adds the feature of keeping a text file open and reading lines from it as they are written by other processes or applications.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-1237) Adds file and url support to stream endpoint. Allows a text file to be polled for continual updates.

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=48841#action_48841 ]

Claus Ibsen commented on CAMEL-1237:
------------------------------------

@Stephen

When using your patch and with a deamon thread I still get a thread hanging while stopping Camel.

"stream:in?initialPromptDelay=4000&promptDelay=2000&promptMessage=Enter some words: thread:1" daemon prio=5 tid=0x01043d20 nid=0x9d4a00 runnable [0xb1011000..0xb1011d90]
        at java.io.FileInputStream.readBytes(Native Method)
        at java.io.FileInputStream.read(FileInputStream.java:194)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:254)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:313)
        - locked <0x093253e8> (a java.io.BufferedInputStream)
        at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:411)
        at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:453)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:183)
        - locked <0x0a457118> (a java.io.InputStreamReader)
        at java.io.InputStreamReader.read(InputStreamReader.java:167)
        at java.io.BufferedReader.fill(BufferedReader.java:136)
        at java.io.BufferedReader.readLine(BufferedReader.java:299)
        - locked <0x0a457118> (a java.io.InputStreamReader)
        at java.io.BufferedReader.readLine(BufferedReader.java:362)
        at org.apache.camel.component.stream.StreamConsumer.readFromStream(StreamConsumer.java:128)
        at org.apache.camel.component.stream.StreamConsumer.run(StreamConsumer.java:96)
        at java.lang.Thread.run(Thread.java:613)


> Adds file and url support to stream endpoint. Allows a text file to be polled for continual updates.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1237
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1237
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-stream
>         Environment: All
>            Reporter: Stephen Joyner
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: StreamConsumer_multThread.txt, StreamEndpoint_patch.txt
>
>
> The camel-stream component is documented to support file and url parameters, but the code in the StreamEnpoint.java file didn't allow these properties to be set. This patch also adds the feature of keeping a text file open and reading lines from it as they are written by other processes or applications.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CAMEL-1237) Adds file and url support to stream endpoint. Allows a text file to be polled for continual updates.

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Stephen Joyner updated CAMEL-1237:
----------------------------------

    Attachment: camel-stream-fix-multithread-patch.zip

I believe this patch should fix the thread error. This diff was created against the head revision.

> Adds file and url support to stream endpoint. Allows a text file to be polled for continual updates.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1237
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1237
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-stream
>         Environment: All
>            Reporter: Stephen Joyner
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: camel-stream-fix-multithread-patch.zip, StreamConsumer_multThread.txt, StreamEndpoint_patch.txt
>
>
> The camel-stream component is documented to support file and url parameters, but the code in the StreamEnpoint.java file didn't allow these properties to be set. This patch also adds the feature of keeping a text file open and reading lines from it as they are written by other processes or applications.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (CAMEL-1237) Adds file and url support to stream endpoint. Allows a text file to be polled for continual updates.

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Claus Ibsen resolved CAMEL-1237.
--------------------------------

    Resolution: Fixed

Commit to trunk: 736242.

Thanks Stephen for the patches.

> Adds file and url support to stream endpoint. Allows a text file to be polled for continual updates.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1237
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1237
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-stream
>         Environment: All
>            Reporter: Stephen Joyner
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: camel-stream-fix-multithread-patch.zip, StreamConsumer_multThread.txt, StreamEndpoint_patch.txt
>
>
> The camel-stream component is documented to support file and url parameters, but the code in the StreamEnpoint.java file didn't allow these properties to be set. This patch also adds the feature of keeping a text file open and reading lines from it as they are written by other processes or applications.

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