You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Peter Kleczka <pk...@gmail.com> on 2011/08/10 18:03:27 UTC

onCompletion error? Polling w/ FTP

Hello

I am using the ftp component to put a file on a directory. A vendor's
software processes that file and puts a response in another directory. I
want to pick up the file from the response directory, read it and based on
its contents create a new response message to put on the queue. I thought
the onCompletion component could help me, but I get an error message saying:
Failed to create route ... because of Not implemented yet for class:
org.apache.camel.model.RouteDefinition

I am using Apache Active MQ 5.4.2 with Camel 2.4.0. The XML for the route is
shown below. Perhaps onCompletion is not the correct solution to this
problem. Thanks in advance for your help. --Peter

       <route id="EFileBatchRequestFTP">
            <from uri="properties:{{queue.efilebatch.request.submitted}}" />
            <to uri="properties:{{log.efilebatch.request.submitted}}" />
            <wireTap
uri="properties:{{queue.efilebatch.request.submitted.tap}}" />
            <bean ref="formatFTPFileName" method="formatName" />
            <to
uri="properties:{{ftp.efilebatch.request.submitted}}?fileName=${header.JMSCorrelationID}.xml"
/>

            <onCompletion onCompleteOnly="true">
                <route id="EFileBatchResponse">
                    <from
uri="properties:{{ftp.efilebatch.response}}?delay=5000&amp;noop=true&amp;recursive=false&amp;include=*.xml"
/>
                    <bean ref="response" method="getResponseMessage" />
                    <to uri="properties:{{queue.efilebatch.response}}" />
                </route>
            </onCompletion>

        </route>

Re: onCompletion error? Polling w/ FTP

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You should not have <route> inside the <onCompletion> tag.

And onCompletion cannot start from a consumer. Its just some extra
work to do when a route has completed.

Read more about on completion in the Camel documentation,

On Wed, Aug 10, 2011 at 6:03 PM, Peter Kleczka <pk...@gmail.com> wrote:
> Hello
>
> I am using the ftp component to put a file on a directory. A vendor's
> software processes that file and puts a response in another directory. I
> want to pick up the file from the response directory, read it and based on
> its contents create a new response message to put on the queue. I thought
> the onCompletion component could help me, but I get an error message saying:
> Failed to create route ... because of Not implemented yet for class:
> org.apache.camel.model.RouteDefinition
>
> I am using Apache Active MQ 5.4.2 with Camel 2.4.0. The XML for the route is
> shown below. Perhaps onCompletion is not the correct solution to this
> problem. Thanks in advance for your help. --Peter
>
>       <route id="EFileBatchRequestFTP">
>            <from uri="properties:{{queue.efilebatch.request.submitted}}" />
>            <to uri="properties:{{log.efilebatch.request.submitted}}" />
>            <wireTap
> uri="properties:{{queue.efilebatch.request.submitted.tap}}" />
>            <bean ref="formatFTPFileName" method="formatName" />
>            <to
> uri="properties:{{ftp.efilebatch.request.submitted}}?fileName=${header.JMSCorrelationID}.xml"
> />
>
>            <onCompletion onCompleteOnly="true">
>                <route id="EFileBatchResponse">
>                    <from
> uri="properties:{{ftp.efilebatch.response}}?delay=5000&amp;noop=true&amp;recursive=false&amp;include=*.xml"
> />
>                    <bean ref="response" method="getResponseMessage" />
>                    <to uri="properties:{{queue.efilebatch.response}}" />
>                </route>
>            </onCompletion>
>
>        </route>
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Fwd: onCompletion error? Polling w/ FTP

Posted by Peter Kleczka <pk...@gmail.com>.
Hi

Please disregard. I got this working by setting up a separate route. I was
thinking that somehow the route that sent the file needed to call the route
that pulls the response file.

---------- Forwarded message ----------
From: Peter Kleczka <pk...@gmail.com>
Date: Wed, Aug 10, 2011 at 10:03 AM
Subject: onCompletion error? Polling w/ FTP
To: users@camel.apache.org


Hello

I am using the ftp component to put a file on a directory. A vendor's
software processes that file and puts a response in another directory. I
want to pick up the file from the response directory, read it and based on
its contents create a new response message to put on the queue. I thought
the onCompletion component could help me, but I get an error message saying:
Failed to create route ... because of Not implemented yet for class:
org.apache.camel.model.RouteDefinition

I am using Apache Active MQ 5.4.2 with Camel 2.4.0. The XML for the route is
shown below. Perhaps onCompletion is not the correct solution to this
problem. Thanks in advance for your help. --Peter

       <route id="EFileBatchRequestFTP">
            <from uri="properties:{{queue.efilebatch.request.submitted}}" />
            <to uri="properties:{{log.efilebatch.request.submitted}}" />
            <wireTap
uri="properties:{{queue.efilebatch.request.submitted.tap}}" />
            <bean ref="formatFTPFileName" method="formatName" />
            <to
uri="properties:{{ftp.efilebatch.request.submitted}}?fileName=${header.JMSCorrelationID}.xml"
/>

            <onCompletion onCompleteOnly="true">
                <route id="EFileBatchResponse">
                    <from
uri="properties:{{ftp.efilebatch.response}}?delay=5000&amp;noop=true&amp;recursive=false&amp;include=*.xml"
/>
                    <bean ref="response" method="getResponseMessage" />
                    <to uri="properties:{{queue.efilebatch.response}}" />
                </route>
            </onCompletion>

        </route>