开发者

Generating multiple files based on DB query in a nice way

I have a following question. I have to generate many files based on sql query.

Let's say for example, I have get from database a list of orders made today and genarate file for each order and later store each file on ftp.

Ideally I would like to get follewing. Not quite sure how to get it.

from(MyBean).to(Ftp)

The problem and main question is how to generate multiple messages by custom bean (for example).

I am not sure if splitter EIP is ok in this case because in my case I have not just one message to split, but I just have to generate and send many messages. http://camel.apache.org/splitter.html

I hope, someone meet this problem before.

If the task will be to generate just one file - everything is quite simple - you need just fill Exchange.OutMessage (or something like this). But what about multiple files - I really can't get, how to manage this situation.

P.S. Sorry if this question is stupid. I am novice in Camel (working with it just for coupe weeks). It's a great tool. Actually开发者_开发问答, that's why I want to use in in the best way.

Thanks a lot.


from("bean:myBean").split(body()).to("bean:ftpBean")

just make sure myBean returns a List of messages and they will be split and sent individually to your FTP endpoint...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜