camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Flatpack Example
Date Tue, 22 May 2012 03:49:34 GMT
Hi

Just a quick suggestion. Have you looked at the unit tests of camel-flatpack?
Often there is "good" examples there.

Also when something doesn't work, mention the Camel version, and what
runtime you use, eg Tomcat, ServiceMix etc.
And especially with OSGi, loading resources on classpath can be tricky.


On Tue, May 22, 2012 at 1:26 AM, Chris Geer <chris@cxtsoftware.com> wrote:
> If there an example anywhere demonstrating how to use the flatpack
> component? I've been playing with it with very little success. I've got the
> very simple case working:
>
>      <camel:camelContext id="flatpackTest" trace="true">
>        <camel:route>
>          <camel:from uri="file:///tmp/inttest"/>
>          <camel:to uri="flatpack:foo"/>
>        </camel:route>
>        <camel:route>
>          <camel:from uri="flatpack:foo"/>
>          <camel:to uri="log:test2?showAll=true"/>
>        </camel:route>
>    </camel:camelContext>
>
> This will create a message on the second route for each line in my file but
> it is essentially useless because it can't parse it without config data.
> Flatpack seems to have a way to pass in a config file using the uri
> "flatpack:[fixed|delim]:<config>" but when I try and use it I can't get it
> to work.
>
>      <camel:camelContext id="flatpackTest" trace="true">
>        <camel:route>
>          <camel:from uri="file:///tmp/inttest"/>
>          <camel:to uri="flatpack:fixed:config.pzmap"/>
>          <camel:to uri="log:firstRoute?showAll=true"/>
>        </camel:route>
>        <camel:route>
>          <camel:from uri="flatpack:fixed:config.pzmap"/>
>          <camel:to uri="log:secondRoute?showAll=true"/>
>        </camel:route>
>    </camel:camelContext>
>
> I'm just not sure what the from in the second route should be. I've tried
> all sorts of combinations but none of them work and the second route never
> gets triggered. The log in the first route will trigger but it just shows
> the body of the message as the Generic File.
>
> In looking through the code it looks like flatpack copies the original
> exchange and passes the messages along to a load balancer. Anyone know what
> the correct "from" uri is for the second route to get all the messages?
>
> Thanks,
> Chris



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
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/

Mime
View raw message