camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Geer <ch...@cxtsoftware.com>
Subject Flatpack Example
Date Mon, 21 May 2012 23:26:28 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message