You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by contactreji <co...@gmail.com> on 2015/03/25 08:09:55 UTC

Json Splitter

Hi

Is there something out of the box in camel which can help me split json
records? 

Regards
Reji



-----
Reji Mathews
Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel & Jboss Fuse ESB | Mule ESB )
LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
Twitter - reji_mathews
--
View this message in context: http://camel.465427.n5.nabble.com/Json-Splitter-tp5764739.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Json Splitter

Posted by "Preben.Asmussen" <pr...@dr.dk>.
Or just convert json to a Map and iterate over that.

/Preben



--
View this message in context: http://camel.465427.n5.nabble.com/Json-Splitter-tp5764739p5764844.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Json Splitter

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Thanks for sharing this.

Would be great to add a sample code and something to the docs such as at

http://camel.apache.org/splitter
http://camel.apache.org/jsonpath

On Fri, Mar 27, 2015 at 5:28 AM, Reji Mathews <co...@gmail.com> wrote:
> Hey that's cool. Let me try my luck and update !
>
> Thanks Minh
>
> Cheers
> Reji
> On 27 Mar 2015 09:48, "Minh Tran" <da...@gmail.com> wrote:
>
>> Here you go.
>>
>> <split streaming="true">
>>         <jsonpath>$.[*]</jsonpath>
>>         ....
>> </split>
>>
>> The json I feed into it is an array, e.g.  [ {...}, {....} ]
>>
>> On 27/03/2015, at 3:08 PM, Reji Mathews <co...@gmail.com> wrote:
>>
>> > Hi Minh
>> >
>> > Did you just say you made the json path work in camel splitter ?
>> >
>> > If so can u share ur splitter component cofig from the route file .
>> >
>> > Cheers
>> > Reji
>> > On 27 Mar 2015 02:56, "Minh Tran" <da...@gmail.com> wrote:
>> >
>> >> I can confirm jsonpath works in a splitter.
>> >>
>> >> On 27/03/2015, at 12:46 AM, Claus Ibsen <[hidden email]
>> >> <http:///user/SendEmail.jtp?type=node&node=5764853&i=0>> wrote:
>> >>
>> >>> Hi
>> >>>
>> >>> I am not sure how far we got with jsonpath
>> >>> http://camel.apache.org/jsonpath
>> >>>
>> >>> But json path may support some kind of iterating json, and if it does
>> >>> we can use it in Camel.
>> >>>
>> >>> Maybe give it a try and check its docs what it can do
>> >>> https://code.google.com/p/json-path/
>> >>>
>> >>> On Thu, Mar 26, 2015 at 2:43 PM, Mark Webb <[hidden email]
>> >> <http:///user/SendEmail.jtp?type=node&node=5764853&i=1>> wrote:
>> >>>> Not that I've seen.  I've had the need for this in the past.  Would
>> >> make a
>> >>>> nice new feature.
>> >>>>
>> >>>> On Wed, Mar 25, 2015 at 3:09 AM, contactreji <[hidden email]
>> >> <http:///user/SendEmail.jtp?type=node&node=5764853&i=2>> wrote:
>> >>>>
>> >>>>> Hi
>> >>>>>
>> >>>>> Is there something out of the box in camel which can help me split
>> >> json
>> >>>>> records?
>> >>>>>
>> >>>>> Regards
>> >>>>> Reji
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> -----
>> >>>>> Reji Mathews
>> >>>>> Sr. Developer - Middleware Integration / SOA ( Open Source - Apache
>> >> Camel
>> >>>>> & Jboss Fuse ESB | Mule ESB )
>> >>>>> LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
>> >>>>> Twitter - reji_mathews
>> >>>>> --
>> >>>>> View this message in context:
>> >>>>> http://camel.465427.n5.nabble.com/Json-Splitter-tp5764739.html
>> >>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>> >>>>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Claus Ibsen
>> >>> -----------------
>> >>> Red Hat, Inc.
>> >>> Email: [hidden email]
>> >> <http:///user/SendEmail.jtp?type=node&node=5764853&i=3>
>> >>> Twitter: davsclaus
>> >>> Blog: http://davsclaus.com
>> >>> Author of Camel in Action: http://www.manning.com/ibsen
>> >>> hawtio: http://hawt.io/
>> >>> fabric8: http://fabric8.io/
>> >>
>> >>
>> >>
>> >> ------------------------------
>> >> If you reply to this email, your message will be added to the discussion
>> >> below:
>> >> http://camel.465427.n5.nabble.com/Json-Splitter-tp5764739p5764853.html
>> >> To unsubscribe from Json Splitter, click here
>> >> <
>> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5764739&code=Y29udGFjdHJlamlAZ21haWwuY29tfDU3NjQ3Mzl8MTAwNDkxODIzMw==
>> >
>> >> .
>> >> NAML
>> >> <
>> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >
>> >>
>>
>>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: Json Splitter

Posted by Reji Mathews <co...@gmail.com>.
Hey that's cool. Let me try my luck and update !

Thanks Minh

Cheers
Reji
On 27 Mar 2015 09:48, "Minh Tran" <da...@gmail.com> wrote:

> Here you go.
>
> <split streaming="true">
>         <jsonpath>$.[*]</jsonpath>
>         ....
> </split>
>
> The json I feed into it is an array, e.g.  [ {...}, {....} ]
>
> On 27/03/2015, at 3:08 PM, Reji Mathews <co...@gmail.com> wrote:
>
> > Hi Minh
> >
> > Did you just say you made the json path work in camel splitter ?
> >
> > If so can u share ur splitter component cofig from the route file .
> >
> > Cheers
> > Reji
> > On 27 Mar 2015 02:56, "Minh Tran" <da...@gmail.com> wrote:
> >
> >> I can confirm jsonpath works in a splitter.
> >>
> >> On 27/03/2015, at 12:46 AM, Claus Ibsen <[hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=5764853&i=0>> wrote:
> >>
> >>> Hi
> >>>
> >>> I am not sure how far we got with jsonpath
> >>> http://camel.apache.org/jsonpath
> >>>
> >>> But json path may support some kind of iterating json, and if it does
> >>> we can use it in Camel.
> >>>
> >>> Maybe give it a try and check its docs what it can do
> >>> https://code.google.com/p/json-path/
> >>>
> >>> On Thu, Mar 26, 2015 at 2:43 PM, Mark Webb <[hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=5764853&i=1>> wrote:
> >>>> Not that I've seen.  I've had the need for this in the past.  Would
> >> make a
> >>>> nice new feature.
> >>>>
> >>>> On Wed, Mar 25, 2015 at 3:09 AM, contactreji <[hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=5764853&i=2>> wrote:
> >>>>
> >>>>> Hi
> >>>>>
> >>>>> Is there something out of the box in camel which can help me split
> >> json
> >>>>> records?
> >>>>>
> >>>>> Regards
> >>>>> Reji
> >>>>>
> >>>>>
> >>>>>
> >>>>> -----
> >>>>> Reji Mathews
> >>>>> Sr. Developer - Middleware Integration / SOA ( Open Source - Apache
> >> Camel
> >>>>> & Jboss Fuse ESB | Mule ESB )
> >>>>> LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
> >>>>> Twitter - reji_mathews
> >>>>> --
> >>>>> View this message in context:
> >>>>> http://camel.465427.n5.nabble.com/Json-Splitter-tp5764739.html
> >>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
> >>>>>
> >>>
> >>>
> >>>
> >>> --
> >>> Claus Ibsen
> >>> -----------------
> >>> Red Hat, Inc.
> >>> Email: [hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=5764853&i=3>
> >>> Twitter: davsclaus
> >>> Blog: http://davsclaus.com
> >>> Author of Camel in Action: http://www.manning.com/ibsen
> >>> hawtio: http://hawt.io/
> >>> fabric8: http://fabric8.io/
> >>
> >>
> >>
> >> ------------------------------
> >> If you reply to this email, your message will be added to the discussion
> >> below:
> >> http://camel.465427.n5.nabble.com/Json-Splitter-tp5764739p5764853.html
> >> To unsubscribe from Json Splitter, click here
> >> <
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5764739&code=Y29udGFjdHJlamlAZ21haWwuY29tfDU3NjQ3Mzl8MTAwNDkxODIzMw==
> >
> >> .
> >> NAML
> >> <
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >>
>
>

Re: Json Splitter

Posted by Minh Tran <da...@gmail.com>.
Here you go.

<split streaming="true">
	<jsonpath>$.[*]</jsonpath>
	….
</split>

The json I feed into it is an array, e.g.  [ {…}, {….} ]

On 27/03/2015, at 3:08 PM, Reji Mathews <co...@gmail.com> wrote:

> Hi Minh
> 
> Did you just say you made the json path work in camel splitter ?
> 
> If so can u share ur splitter component cofig from the route file .
> 
> Cheers
> Reji
> On 27 Mar 2015 02:56, "Minh Tran" <da...@gmail.com> wrote:
> 
>> I can confirm jsonpath works in a splitter.
>> 
>> On 27/03/2015, at 12:46 AM, Claus Ibsen <[hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=5764853&i=0>> wrote:
>> 
>>> Hi
>>> 
>>> I am not sure how far we got with jsonpath
>>> http://camel.apache.org/jsonpath
>>> 
>>> But json path may support some kind of iterating json, and if it does
>>> we can use it in Camel.
>>> 
>>> Maybe give it a try and check its docs what it can do
>>> https://code.google.com/p/json-path/
>>> 
>>> On Thu, Mar 26, 2015 at 2:43 PM, Mark Webb <[hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=5764853&i=1>> wrote:
>>>> Not that I've seen.  I've had the need for this in the past.  Would
>> make a
>>>> nice new feature.
>>>> 
>>>> On Wed, Mar 25, 2015 at 3:09 AM, contactreji <[hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=5764853&i=2>> wrote:
>>>> 
>>>>> Hi
>>>>> 
>>>>> Is there something out of the box in camel which can help me split
>> json
>>>>> records?
>>>>> 
>>>>> Regards
>>>>> Reji
>>>>> 
>>>>> 
>>>>> 
>>>>> -----
>>>>> Reji Mathews
>>>>> Sr. Developer - Middleware Integration / SOA ( Open Source - Apache
>> Camel
>>>>> & Jboss Fuse ESB | Mule ESB )
>>>>> LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
>>>>> Twitter - reji_mathews
>>>>> --
>>>>> View this message in context:
>>>>> http://camel.465427.n5.nabble.com/Json-Splitter-tp5764739.html
>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Claus Ibsen
>>> -----------------
>>> Red Hat, Inc.
>>> Email: [hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=5764853&i=3>
>>> Twitter: davsclaus
>>> Blog: http://davsclaus.com
>>> Author of Camel in Action: http://www.manning.com/ibsen
>>> hawtio: http://hawt.io/
>>> fabric8: http://fabric8.io/
>> 
>> 
>> 
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>> http://camel.465427.n5.nabble.com/Json-Splitter-tp5764739p5764853.html
>> To unsubscribe from Json Splitter, click here
>> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5764739&code=Y29udGFjdHJlamlAZ21haWwuY29tfDU3NjQ3Mzl8MTAwNDkxODIzMw==>
>> .
>> NAML
>> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>> 


Re: Json Splitter

Posted by Reji Mathews <co...@gmail.com>.
Hi Minh

Did you just say you made the json path work in camel splitter ?

If so can u share ur splitter component cofig from the route file .

Cheers
Reji
On 27 Mar 2015 02:56, "Minh Tran" <da...@gmail.com> wrote:

> I can confirm jsonpath works in a splitter.
>
> On 27/03/2015, at 12:46 AM, Claus Ibsen <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5764853&i=0>> wrote:
>
> > Hi
> >
> > I am not sure how far we got with jsonpath
> > http://camel.apache.org/jsonpath
> >
> > But json path may support some kind of iterating json, and if it does
> > we can use it in Camel.
> >
> > Maybe give it a try and check its docs what it can do
> > https://code.google.com/p/json-path/
> >
> > On Thu, Mar 26, 2015 at 2:43 PM, Mark Webb <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5764853&i=1>> wrote:
> >> Not that I've seen.  I've had the need for this in the past.  Would
> make a
> >> nice new feature.
> >>
> >> On Wed, Mar 25, 2015 at 3:09 AM, contactreji <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5764853&i=2>> wrote:
> >>
> >>> Hi
> >>>
> >>> Is there something out of the box in camel which can help me split
> json
> >>> records?
> >>>
> >>> Regards
> >>> Reji
> >>>
> >>>
> >>>
> >>> -----
> >>> Reji Mathews
> >>> Sr. Developer - Middleware Integration / SOA ( Open Source - Apache
> Camel
> >>> & Jboss Fuse ESB | Mule ESB )
> >>> LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
> >>> Twitter - reji_mathews
> >>> --
> >>> View this message in context:
> >>> http://camel.465427.n5.nabble.com/Json-Splitter-tp5764739.html
> >>> Sent from the Camel - Users mailing list archive at Nabble.com.
> >>>
> >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > Red Hat, Inc.
> > Email: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5764853&i=3>
> > Twitter: davsclaus
> > Blog: http://davsclaus.com
> > Author of Camel in Action: http://www.manning.com/ibsen
> > hawtio: http://hawt.io/
> > fabric8: http://fabric8.io/
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Json-Splitter-tp5764739p5764853.html
>  To unsubscribe from Json Splitter, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5764739&code=Y29udGFjdHJlamlAZ21haWwuY29tfDU3NjQ3Mzl8MTAwNDkxODIzMw==>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>

Re: Json Splitter

Posted by Minh Tran <da...@gmail.com>.
I can confirm jsonpath works in a splitter.

On 27/03/2015, at 12:46 AM, Claus Ibsen <cl...@gmail.com> wrote:

> Hi
> 
> I am not sure how far we got with jsonpath
> http://camel.apache.org/jsonpath
> 
> But json path may support some kind of iterating json, and if it does
> we can use it in Camel.
> 
> Maybe give it a try and check its docs what it can do
> https://code.google.com/p/json-path/
> 
> On Thu, Mar 26, 2015 at 2:43 PM, Mark Webb <el...@gmail.com> wrote:
>> Not that I've seen.  I've had the need for this in the past.  Would make a
>> nice new feature.
>> 
>> On Wed, Mar 25, 2015 at 3:09 AM, contactreji <co...@gmail.com> wrote:
>> 
>>> Hi
>>> 
>>> Is there something out of the box in camel which can help me split json
>>> records?
>>> 
>>> Regards
>>> Reji
>>> 
>>> 
>>> 
>>> -----
>>> Reji Mathews
>>> Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel
>>> & Jboss Fuse ESB | Mule ESB )
>>> LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
>>> Twitter - reji_mathews
>>> --
>>> View this message in context:
>>> http://camel.465427.n5.nabble.com/Json-Splitter-tp5764739.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>> 
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/


Re: Json Splitter

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I am not sure how far we got with jsonpath
http://camel.apache.org/jsonpath

But json path may support some kind of iterating json, and if it does
we can use it in Camel.

Maybe give it a try and check its docs what it can do
https://code.google.com/p/json-path/

On Thu, Mar 26, 2015 at 2:43 PM, Mark Webb <el...@gmail.com> wrote:
> Not that I've seen.  I've had the need for this in the past.  Would make a
> nice new feature.
>
> On Wed, Mar 25, 2015 at 3:09 AM, contactreji <co...@gmail.com> wrote:
>
>> Hi
>>
>> Is there something out of the box in camel which can help me split json
>> records?
>>
>> Regards
>> Reji
>>
>>
>>
>> -----
>> Reji Mathews
>> Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel
>> & Jboss Fuse ESB | Mule ESB )
>> LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
>> Twitter - reji_mathews
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Json-Splitter-tp5764739.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: Json Splitter

Posted by Mark Webb <el...@gmail.com>.
Not that I've seen.  I've had the need for this in the past.  Would make a
nice new feature.

On Wed, Mar 25, 2015 at 3:09 AM, contactreji <co...@gmail.com> wrote:

> Hi
>
> Is there something out of the box in camel which can help me split json
> records?
>
> Regards
> Reji
>
>
>
> -----
> Reji Mathews
> Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel
> & Jboss Fuse ESB | Mule ESB )
> LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
> Twitter - reji_mathews
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Json-Splitter-tp5764739.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>