Split sql result by goup

24 views
Skip to first unread message

ibrahimovic zlatan

unread,
Oct 8, 2015, 5:27:36 AM10/8/15
to Camel User Group-Denmark
Hi,
how can i split an sql result by goup with Camel (example: 1000 by 1000 ) ?

Søren Berg Glasius

unread,
Oct 8, 2015, 5:43:51 AM10/8/15
to camel-user-g...@googlegroups.com
If you use Groovy and you use a result from Sql('xxx').rows() you could probably apply http://docs.groovy-lang.org/latest/html/groovy-jdk/java/lang/Iterable.html#collate(int, int)




Best regards / Med venlig hilsen,
Søren Berg Glasius

Hedevej 1, Gl. Rye, 8680 Ry, Denmark
Mobile: +45 40 44 91 88, Skype: sbglasius
--- Press ESC once to quit - twice to save the changes.

On 8 October 2015 at 11:27, ibrahimovic zlatan <zied...@gmail.com> wrote:
Hi,
how can i split an sql result by goup with Camel (example: 1000 by 1000 ) ?

--
Du har modtaget denne besked, fordi du abonnerer på gruppen "Camel User Group-Denmark" i Google Grupper.
Hvis du vil ophæve abonnementet på denne gruppe og ikke længere modtage e-mails fra den, skal du sende en e-mail til camel-user-group-d...@googlegroups.com.
Du kan se flere muligheder ved at besøge https://groups.google.com/d/optout.

ibrahimovic zlatan

unread,
Oct 8, 2015, 7:19:13 AM10/8/15
to Camel User Group-Denmark
Thank you for your reply ! I'm using JbossFuse and the route is set in blueprint.xml

 
Le jeudi 8 octobre 2015 10:43:51 UTC+1, Søren Berg Glasius a écrit :
If you use Groovy and you use a result from Sql('xxx').rows() you could probably apply http://docs.groovy-lang.org/latest/html/groovy-jdk/java/lang/Iterable.html#collate(int, int)




Best regards / Med venlig hilsen,
Søren Berg Glasius

Hedevej 1, Gl. Rye, 8680 Ry, Denmark
Mobile: +45 40 44 91 88, Skype: sbglasius
--- Press ESC once to quit - twice to save the changes.

On 8 October 2015 at 11:27, ibrahimovic zlatan <zied...@gmail.com> wrote:
Hi,
how can i split an sql result by goup with Camel (example: 1000 by 1000 ) ?

--
Du har modtaget denne besked, fordi du abonnerer på gruppen "Camel User Group-Denmark" i Google Grupper.
Hvis du vil ophæve abonnementet på denne gruppe og ikke længere modtage e-mails fra den, skal du sende en e-mail til camel-user-group-denmark+unsub...@googlegroups.com.

Claus Ibsen

unread,
Oct 8, 2015, 8:25:12 AM10/8/15
to camel-user-g...@googlegroups.com
Hi

You may want to use the Camel user mailing list or user forum for
Camel questions, as there is a lot more people there, than in this
danish user group.
http://camel.apache.org/support.html


There is a splitter group N lines
http://camel.apache.org/splitter

But its frankly using a tokenizer which assume a single payload to be
sliced using a token splitter.

I assume you want to split up a ResultSet into chunks of 1000. For
that you could write a bit that iterates that over the chunk and use
that to the splitter.

But having that easily out of the box which you can configure from xml
would be cool to. So I would suggest you could log a RFE in the Camel
JIRA
http://camel.apache.org/support.html

On Thu, Oct 8, 2015 at 11:27 AM, ibrahimovic zlatan <zied...@gmail.com> wrote:
> Hi,
> how can i split an sql result by goup with Camel (example: 1000 by 1000 ) ?
>
> --
> Du har modtaget denne besked, fordi du abonnerer på gruppen "Camel User
> Group-Denmark" i Google Grupper.
> Hvis du vil ophæve abonnementet på denne gruppe og ikke længere modtage
> e-mails fra den, skal du sende en e-mail til
> camel-user-group-d...@googlegroups.com.
> Du kan se flere muligheder ved at besøge https://groups.google.com/d/optout.



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition:
https://www.manning.com/books/camel-in-action-second-edition

Søren Berg Glasius

unread,
Oct 8, 2015, 8:39:29 AM10/8/15
to camel-user-g...@googlegroups.com
And I'm sorry, I responded as it was a Groovy related question? Listen to Claus, he knows what he is talking about :)


Best regards / Med venlig hilsen,
Søren Berg Glasius

Hedevej 1, Gl. Rye, 8680 Ry, Denmark
Mobile: +45 40 44 91 88, Skype: sbglasius
--- Press ESC once to quit - twice to save the changes.

Du har modtaget denne besked, fordi du er tilmeldt gruppen "Camel User Group-Denmark" i Google Grupper.

Hvis du vil ophæve abonnementet på denne gruppe og ikke længere modtage e-mails fra den, skal du sende en e-mail til camel-user-group-d...@googlegroups.com.
Find flere valgmuligheder på https://groups.google.com/d/optout.

ibrahimovic zlatan

unread,
Oct 9, 2015, 6:16:33 AM10/9/15
to Camel User Group-Denmark
Hi,
I sent a subscription request and i still waiting for reply !

Claus Ibsen

unread,
Oct 9, 2015, 6:29:19 AM10/9/15
to camel-user-g...@googlegroups.com
Hi

Maybe its in your spam or junk folder or something.
>> > camel-user-group-d...@googlegroups.com.
>> > Du kan se flere muligheder ved at besøge
>> > https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2nd edition:
>> https://www.manning.com/books/camel-in-action-second-edition
>
> --
> Du har modtaget denne besked, fordi du abonnerer på gruppen "Camel User
> Group-Denmark" i Google Grupper.
> Hvis du vil ophæve abonnementet på denne gruppe og ikke længere modtage
> e-mails fra den, skal du sende en e-mail til
> camel-user-group-d...@googlegroups.com.

Claus Ibsen

unread,
Oct 9, 2015, 9:32:08 AM10/9/15
to camel-user-g...@googlegroups.com
Hi

I am not sure what happens to your subscribe request.

I logged a ticket about your request
https://issues.apache.org/jira/browse/CAMEL-9207
>> > camel-user-group-d...@googlegroups.com.
>> > Du kan se flere muligheder ved at besøge
>> > https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2nd edition:
>> https://www.manning.com/books/camel-in-action-second-edition
>
> --
> Du har modtaget denne besked, fordi du abonnerer på gruppen "Camel User
> Group-Denmark" i Google Grupper.
> Hvis du vil ophæve abonnementet på denne gruppe og ikke længere modtage
> e-mails fra den, skal du sende en e-mail til
> camel-user-group-d...@googlegroups.com.

ibrahimovic zlatan

unread,
Oct 13, 2015, 10:08:50 AM10/13/15
to Camel User Group-Denmark
Thanks Claus !
>> > camel-user-group-denmark+unsub...@googlegroups.com.
>> > Du kan se flere muligheder ved at besøge
>> > https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2nd edition:
>> https://www.manning.com/books/camel-in-action-second-edition
>
> --
> Du har modtaget denne besked, fordi du abonnerer på gruppen "Camel User
> Group-Denmark" i Google Grupper.
> Hvis du vil ophæve abonnementet på denne gruppe og ikke længere modtage
> e-mails fra den, skal du sende en e-mail til
> camel-user-group-denmark+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages