You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Erik Allais <er...@altervisions.com> on 2007/08/09 12:29:25 UTC

Message translator idea

Hi,

i read that the Message translator pattern is used to translate one data
format into another.
I got a xml data format and i want to transform this document into a SQL
query.

I develop my own XQuery to transform the xml document.
How i can i use this XQuery inside the Message translator?

Regards,
Erik
-- 
View this message in context: http://www.nabble.com/Message-translator-idea-tf4241843s22882.html#a12070036
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Message translator idea

Posted by Erik Allais <er...@altervisions.com>.
According to my study case, 
Do you think i can use the XQuery from camel or from the saxon component?

Have no idea how to proceed...

REgards,
ERik


gnodet wrote:
> 
> There is a JBI component which has been moved a few hours ago from
> camel to ServiceMix.  So of course, this one is not released yet, but
> you should be able to build it from the sources of servicemix trunk.
> 
> On 8/9/07, Erik Allais <er...@altervisions.com> wrote:
>>
>> In fact, i must use camel inside ServiceMix and i wonder
>> if i must use the xquery saxon processor provide by servicemix (and how
>> ?)
>> or if camel provide its own implementation (and its useless to use the
>> saxon
>> component)
>>
>> PS: How cna i deploy the camel inside servicemix, seems there is no jbi ?
>>
>>
>>
>> James.Strachan wrote:
>> >
>> > On 8/9/07, Erik Allais <er...@altervisions.com> wrote:
>> >> Hi,
>> >>
>> >> i read that the Message translator pattern is used to translate one
>> data
>> >> format into another.
>> >> I got a xml data format and i want to transform this document into a
>> SQL
>> >> query.
>> >>
>> >> I develop my own XQuery to transform the xml document.
>> >> How i can i use this XQuery inside the Message translator?
>> >
>> > You can use XQuery as a predicate or expression in any of the EIP
>> > patterns you like.
>> > http://activemq.apache.org/camel/xquery.html
>> >
>> > So for example, using the Java DSL you could do something like
>> >
>> > String xqueryCommand = ...;
>> >
>> from("file:myDirectory").setBody(xquery(xqueryCommand)).to("file:updatedFiles")
>> >
>> > (BTW if you want to create the XQuery expression from a separate
>> > file/URL thats fine too)
>> >
>> > Let us know how you get on! It'd be good to create an example for
>> > folks showing how to use XQuery with SQL to transform messages!
>> >
>> > --
>> > James
>> > -------
>> > http://macstrac.blogspot.com/
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Message-translator-idea-tf4241843s22882.html#a12070884
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/Message-translator-idea-tf4241843s22882.html#a12071532
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Message translator idea

Posted by Guillaume Nodet <gn...@gmail.com>.
There is a JBI component which has been moved a few hours ago from
camel to ServiceMix.  So of course, this one is not released yet, but
you should be able to build it from the sources of servicemix trunk.

On 8/9/07, Erik Allais <er...@altervisions.com> wrote:
>
> In fact, i must use camel inside ServiceMix and i wonder
> if i must use the xquery saxon processor provide by servicemix (and how ?)
> or if camel provide its own implementation (and its useless to use the saxon
> component)
>
> PS: How cna i deploy the camel inside servicemix, seems there is no jbi ?
>
>
>
> James.Strachan wrote:
> >
> > On 8/9/07, Erik Allais <er...@altervisions.com> wrote:
> >> Hi,
> >>
> >> i read that the Message translator pattern is used to translate one data
> >> format into another.
> >> I got a xml data format and i want to transform this document into a SQL
> >> query.
> >>
> >> I develop my own XQuery to transform the xml document.
> >> How i can i use this XQuery inside the Message translator?
> >
> > You can use XQuery as a predicate or expression in any of the EIP
> > patterns you like.
> > http://activemq.apache.org/camel/xquery.html
> >
> > So for example, using the Java DSL you could do something like
> >
> > String xqueryCommand = ...;
> > from("file:myDirectory").setBody(xquery(xqueryCommand)).to("file:updatedFiles")
> >
> > (BTW if you want to create the XQuery expression from a separate
> > file/URL thats fine too)
> >
> > Let us know how you get on! It'd be good to create an example for
> > folks showing how to use XQuery with SQL to transform messages!
> >
> > --
> > James
> > -------
> > http://macstrac.blogspot.com/
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Message-translator-idea-tf4241843s22882.html#a12070884
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/

Re: Message translator idea

Posted by Erik Allais <er...@altervisions.com>.
In fact, i must use camel inside ServiceMix and i wonder 
if i must use the xquery saxon processor provide by servicemix (and how ?)
or if camel provide its own implementation (and its useless to use the saxon
component)

PS: How cna i deploy the camel inside servicemix, seems there is no jbi ?



James.Strachan wrote:
> 
> On 8/9/07, Erik Allais <er...@altervisions.com> wrote:
>> Hi,
>>
>> i read that the Message translator pattern is used to translate one data
>> format into another.
>> I got a xml data format and i want to transform this document into a SQL
>> query.
>>
>> I develop my own XQuery to transform the xml document.
>> How i can i use this XQuery inside the Message translator?
> 
> You can use XQuery as a predicate or expression in any of the EIP
> patterns you like.
> http://activemq.apache.org/camel/xquery.html
> 
> So for example, using the Java DSL you could do something like
> 
> String xqueryCommand = ...;
> from("file:myDirectory").setBody(xquery(xqueryCommand)).to("file:updatedFiles")
> 
> (BTW if you want to create the XQuery expression from a separate
> file/URL thats fine too)
> 
> Let us know how you get on! It'd be good to create an example for
> folks showing how to use XQuery with SQL to transform messages!
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/Message-translator-idea-tf4241843s22882.html#a12070884
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Message translator idea

Posted by James Strachan <ja...@gmail.com>.
On 8/9/07, Erik Allais <er...@altervisions.com> wrote:
> Hi,
>
> i read that the Message translator pattern is used to translate one data
> format into another.
> I got a xml data format and i want to transform this document into a SQL
> query.
>
> I develop my own XQuery to transform the xml document.
> How i can i use this XQuery inside the Message translator?

You can use XQuery as a predicate or expression in any of the EIP
patterns you like.
http://activemq.apache.org/camel/xquery.html

So for example, using the Java DSL you could do something like

String xqueryCommand = ...;
from("file:myDirectory").setBody(xquery(xqueryCommand)).to("file:updatedFiles")

(BTW if you want to create the XQuery expression from a separate
file/URL thats fine too)

Let us know how you get on! It'd be good to create an example for
folks showing how to use XQuery with SQL to transform messages!

-- 
James
-------
http://macstrac.blogspot.com/