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