You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Bak Attila <ba...@gmail.com> on 2009/10/28 15:26:56 UTC

Tip needed: easiest way to split

Hi,

I have a timer-based sql query which works ok.
from("timer://foo?period=1000").
		 	to("sql:select * from error?dataSourceRef=dataSource").split(???))
the result from the sql poll is coming in a list. What would be the easiest
way to split this List as would need to process the retrieved rows as
separate messages.
Is there a built-in mechanism for this?

Thanks
attila
-- 
View this message in context: http://www.nabble.com/Tip-needed%3A-easiest-way-to-split-tp26095446p26095446.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Tip needed: easiest way to split

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Oct 28, 2009 at 3:41 PM, Bak Attila <ba...@gmail.com> wrote:
>
> Hi
>
> Thanks. split(body()) works like a charm. Great piece of software although i
> would like to see these and other small tricks documented :)
> The many ValueBuilders, Expressions can be misleading a bit when not
> explained in detail ;-)

Will be documented here
Author of Camel in Action: http://www.manning.com/ibsen/



> I am pretty sure that there exists a built-in solution for everything i have
> created as of now :)
>
> Currently i am working on a big integration project with Camel and i find it
> really great.
>

Cool. I hope that Camel grow on you and you find it useable in your project.



> Regards,
> attila
>
>
>
> Claus Ibsen-2 wrote:
>>
>> On Wed, Oct 28, 2009 at 3:26 PM, Bak Attila <ba...@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> I have a timer-based sql query which works ok.
>>> from("timer://foo?period=1000").
>>>                        to("sql:select * from
>>> error?dataSourceRef=dataSource").split(???))
>>> the result from the sql poll is coming in a list. What would be the
>>> easiest
>>> way to split this List as would need to process the retrieved rows as
>>> separate messages.
>>> Is there a built-in mechanism for this?
>>>
>>
>> Ah we could add an option like atom/rss about splitEntries.
>>
>> I assume you should be able to do that in Java DSL using the splitter just
>> by
>>  from("timer://foo?period=1000").
>>                         to("sql:select * from
>> error?dataSourceRef=dataSource").split(body())
>>
>> As the body itself is a List which can be splitted as an list is
>> iterateable.
>>
>> But that option would be nicer as it stands out and the Spring DSL can
>> easier set that option.
>>
>> Feel free to create a ticket in JIRA for this.
>>
>>
>>
>>
>>> Thanks
>>> attila
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Tip-needed%3A-easiest-way-to-split-tp26095446p26095446.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Tip-needed%3A-easiest-way-to-split-tp26095446p26095889.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Tip needed: easiest way to split

Posted by Bak Attila <ba...@gmail.com>.
Hi

Thanks. split(body()) works like a charm. Great piece of software although i
would like to see these and other small tricks documented :)
The many ValueBuilders, Expressions can be misleading a bit when not
explained in detail ;-)
I am pretty sure that there exists a built-in solution for everything i have
created as of now :)

Currently i am working on a big integration project with Camel and i find it
really great.

Regards,
attila



Claus Ibsen-2 wrote:
> 
> On Wed, Oct 28, 2009 at 3:26 PM, Bak Attila <ba...@gmail.com> wrote:
>>
>> Hi,
>>
>> I have a timer-based sql query which works ok.
>> from("timer://foo?period=1000").
>>                        to("sql:select * from
>> error?dataSourceRef=dataSource").split(???))
>> the result from the sql poll is coming in a list. What would be the
>> easiest
>> way to split this List as would need to process the retrieved rows as
>> separate messages.
>> Is there a built-in mechanism for this?
>>
> 
> Ah we could add an option like atom/rss about splitEntries.
> 
> I assume you should be able to do that in Java DSL using the splitter just
> by
>  from("timer://foo?period=1000").
>                         to("sql:select * from
> error?dataSourceRef=dataSource").split(body())
> 
> As the body itself is a List which can be splitted as an list is
> iterateable.
> 
> But that option would be nicer as it stands out and the Spring DSL can
> easier set that option.
> 
> Feel free to create a ticket in JIRA for this.
> 
> 
> 
> 
>> Thanks
>> attila
>> --
>> View this message in context:
>> http://www.nabble.com/Tip-needed%3A-easiest-way-to-split-tp26095446p26095446.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: http://www.nabble.com/Tip-needed%3A-easiest-way-to-split-tp26095446p26095889.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Tip needed: easiest way to split

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Oct 28, 2009 at 3:26 PM, Bak Attila <ba...@gmail.com> wrote:
>
> Hi,
>
> I have a timer-based sql query which works ok.
> from("timer://foo?period=1000").
>                        to("sql:select * from error?dataSourceRef=dataSource").split(???))
> the result from the sql poll is coming in a list. What would be the easiest
> way to split this List as would need to process the retrieved rows as
> separate messages.
> Is there a built-in mechanism for this?
>

Ah we could add an option like atom/rss about splitEntries.

I assume you should be able to do that in Java DSL using the splitter just by
 from("timer://foo?period=1000").
                        to("sql:select * from
error?dataSourceRef=dataSource").split(body())

As the body itself is a List which can be splitted as an list is iterateable.

But that option would be nicer as it stands out and the Spring DSL can
easier set that option.

Feel free to create a ticket in JIRA for this.




> Thanks
> attila
> --
> View this message in context: http://www.nabble.com/Tip-needed%3A-easiest-way-to-split-tp26095446p26095446.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus