On Aug 23, 2007, at 10:03 AM, Nodet Guillaume wrote:
On Aug 23, 2007, at 5:41 AM, Brian O'Neill wrote:
Exchanges can be created using the Channel#createExchange method.
The only change I'd like to
integrate in the messaging API is to allow for non xml payloads and
maybe untyped attachments. The body
could be converted automatically to a given type if supported (I
think Camel does it nicely, so I'm thinking of
shamelessly copying the converter layer). I have added a few helper
methods on the exchanges and
messages (copy, copyFrom, ensureReReadable, display) to ease message
management.
I haven't looked at Camel converters, but would you consider adding a
contentType and contentEncoding mimicing the headers of HTTP & SIP.
The endpoint can then use the type and encoding to determine how to
handle the content.
I'm open. Would the contentType be a mime type? In such a case it
is not
sufficient to know how the content is represented. For example if
the content
type is xml, you can still have a plain stream, a Source or a DOM
document.
Camel converters may help here. Type converters are explained at
http://activemq.apache.org/camel/type-converter.html
Btw, it makes me think of another related issue. Should we add
headers to the attachments, where
the attachment would be an Object + a set of headers rather than just
the object? Usually attachments
come from a mime request and some headers may be associated with
them. As anyone ever seen the
need to obtain these attachments? I know CXF keep them, so I'm quite
sure there is a good reason.
Cheers,
Guillaume Nodet