You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by James Strachan <ja...@gmail.com> on 2007/10/01 16:32:47 UTC

musings on Source/Sink integration (e.g. serialization v JAXB2 v SOAP encoding etc)

I've been pondering about the cleanest way to add support for multiple
message formats into Camel. e.g. supporting various Sources (input
formats) or Sinks (output formats) such as serialization, JAXB2, Jibx,
IIOP, Artix DS/C24 encoding or custom wire formats and so forth.

I was wondering if we should make them explicit in the DSL or XML such as

// parse as JAXB2 via XML and call a bean
from("file://foo/bar").
  source("jaxb").
	to("ref:someBean");
	
or
	
// parse Java serialization and write out as XML
from("file://foo/bar").
  source("serialization").
	sink("jaxb").
	to("file://xyz");

I was even wondering if we should use MIME Content-Type headers rather
like HTTP does; and have Source/Sinks auto-defaulted to those. e.g. if
a MIME type is "application/xml" then we'd auto-default to JAXB2
instead of Java Serialization etc.
	
Am a tad worried about putting in too much magic; plus using a
Source/Sink does seem kinda optional stuff, so was thinking we'd just
leave it as an optional feature in the DSL; you can explicitly use
them when you like?

Though I did wonder if it might make sense to kinda define default
Source / Sink options; as often folks just wanna use JAXB2 everywhere
unless overridden etc.

e.g.

source("jaxb");

// we'll marshall into and out of JAXB2 here by default...
from("file://foo/bar").to("file://xyz");

Thoughts?

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

Open Source SOA
http://open.iona.com

Re: musings on Source/Sink integration (e.g. serialization v JAXB2 v SOAP encoding etc)

Posted by Hiram Chirino <hi...@hiramchirino.com>.
+1 I like that.

On Jan 21, 2008 5:11 AM, James Strachan <ja...@gmail.com> wrote:
> On 18/01/2008, Christian Schneider <ch...@die-schneider.net> wrote:
> >
> > When you decide for using the DSL I would recommend to name the methods
> > sourceFormat and sinkFormat so it is clearer what they do. Source could
> > easily be understood to have the same meaning as from.
> >
> > What do you think?
>
> Good point!
>
> In the end to make it even more obvious, I went with unmarshal() and
> marshal() to be even more descriptive.
> http://activemq.apache.org/camel/data-format.html
>
> e.g.
>
> from(...).
>   unmarshal().serialization().
>   marshal().jaxb().
>   to(...)
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://open.iona.com
>



-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Open Source SOA
http://open.iona.com

Re: musings on Source/Sink integration (e.g. serialization v JAXB2 v SOAP encoding etc)

Posted by James Strachan <ja...@gmail.com>.
On 18/01/2008, Christian Schneider <ch...@die-schneider.net> wrote:
>
> When you decide for using the DSL I would recommend to name the methods
> sourceFormat and sinkFormat so it is clearer what they do. Source could
> easily be understood to have the same meaning as from.
>
> What do you think?

Good point!

In the end to make it even more obvious, I went with unmarshal() and
marshal() to be even more descriptive.
http://activemq.apache.org/camel/data-format.html

e.g.

from(...).
  unmarshal().serialization().
  marshal().jaxb().
  to(...)

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

Open Source Integration
http://open.iona.com

Re: musings on Source/Sink integration (e.g. serialization v JAXB2 v SOAP encoding etc)

Posted by Christian Schneider <ch...@die-schneider.net>.
When you decide for using the DSL I would recommend to name the methods
sourceFormat and sinkFormat so it is clearer what they do. Source could
easily be understood to have the same meaning as from.

What do you think?

Best regards

Chris


James.Strachan wrote:
> 
> I was wondering if we should make them explicit in the DSL or XML such as
> 
> // parse as JAXB2 via XML and call a bean
> from("file://foo/bar").
>   source("jaxb").
> 	to("ref:someBean");
> 	
> or
> 	
> // parse Java serialization and write out as XML
> from("file://foo/bar").
>   source("serialization").
> 	sink("jaxb").
> 	to("file://xyz");
> 
-- 
View this message in context: http://www.nabble.com/musings-on-Source-Sink-integration-%28e.g.-serialization-v-JAXB2-v-SOAP-encoding-etc%29-tp12980367s22882p14957764.html
Sent from the Camel - Development mailing list archive at Nabble.com.