Isn't that exactly what you expect? :) The camel:run plugin makes it so that you could run your route continuously (until you press ^C). If you want to just send a few messages a unit test would be more appropriate.

Please take a look at the routes to better understand how the code works. Basically there is a route waiting for reservation requests. I use the file: component and the directory ends with .../reservations. You only need to copy a file there and the camel route processes it right away. There are some sample files under ./src/test/resources somewhere. Then a request is 'sent' to an external system, which at some point sends back a reply. That is simulated by copying the *-<reply>.xml files being copied to the reply directory (reply in ['hotel', 'flight', 'car']). The reply is processed and reconciled with the request, the system waits to see if all replies were received and processed and if so continues with the process, simulated by the finalized request being sent to the completed dir.

You have to make sure that the routes start, i.e. the directories exist/can be created in your system. Relative paths work too, that's what I used in the unit tests (you'd have to change the route definition though). The reason I used absolute paths is because I demonstrated that you don't need your process to run all the time. You can stop it, restart it later and it'll continue from where it left off. Not only that, it doesn't even need to be the *same* process. In my presentation, I ran half of it in a Karaf OSGi container, then stopped it, started a bit later standalone and the process continued normally. The point I was making is that Camel is stateless and the state is persisted elsewhere (in the file system in my demo, but could as well be a database, jms queues, etc).

I hope this helps,
Hadrian


On 06/21/2013 03:16 PM, Sean Beck wrote:
Everything installed fine for camelone but I ran mvn camel:run and it seems
to have gotten stuck after first [INFO]


On Fri, Jun 21, 2013 at 12:27 PM, Sean Beck <seanmckayb...@gmail.com> wrote:

Thanks for the response! I'll look now and let you know


On Fri, Jun 21, 2013 at 12:24 PM, Hadrian Zbarcea <hzbar...@gmail.com>wrote:

Sean,

I presented at CamelOne last week on how to handle exactly this kind of
scenarios with Camel and claimcheck. The code and slides are available on
github [1]. Please take a look and let me know if you have any questions.

Cheers,
Hadrian

[1] https://github.com/hzbarcea/**camelone<https://github.com/hzbarcea/camelone>



On 06/21/2013 01:21 PM, Sean Beck wrote:

Could I create my own AggregationStrategy class that stores all the
messages and handles them appropriately? Or is there an easier way?


On Fri, Jun 21, 2013 at 9:19 AM, Sean Beck <seanmckayb...@gmail.com>
wrote:

  Thanks for the response.

The separate process is a program that puts two files together. Multiple
clients with their own SSIDs send over files, and there are 2 files
that go
together for each set of data operated on by the client. As soon as the
files are received on my server the server sends a message containing
the
file path, file name, SSID, and the "type" of the file. I want to use
Camel
to detect when I get two messages for the same file name but each of a
different type (there are only two types) from the same SSID, then once
I
get both messages start up the program that combines the two files.

So I know I want an aggregator that starts the process based off a
completion size of 2, but I don't know how everything works to really
break
the problem down. 1) I need to figure out how I would execute the
program
(which it looks like would be exec) 2) Have one aggregator that can put
messages together from different SSIDs.


On Fri, Jun 21, 2013 at 12:27 AM, Claus Ibsen <claus.ib...@gmail.com
wrote:

  Hi

Can you be more specific with what  you mean with separate process?

There is an exec to run an executable
http://camel.apache.org/exec


On Fri, Jun 21, 2013 at 1:19 AM, Sean Beck <seanmckayb...@gmail.com>
wrote:

So I have figured out how to gather messages based on my criteria. A
process needs to be started as soon as two messages have been
received.
Currently I have:

from("jms:newFileQueue").**aggregate(new
HeaderExpression("**CamelFileName")).**completionSize(2).to("**
triggerservice

to

process and merge files")

The portion I am unsure on is the very last call to to(). How would I

start

up a separate process once I get the necessary completionSize?

Thanks




--
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen







Reply via email to