Hi all,
I may be totally off but, it seems that Camel Message headers are
being used too liberally. Some headers are added by components for
doing their jobs with no intention to send them as protocol headers.
Some headers are objects/non-string and are not suitable to be sent as
headers anyway. When an app reads headers from a message, it does not
really know whether a header is actually a protocol header or
something that gets added by Camel. Likewise, when an app needs to
set some protocol headers, Message.setHeader() does not seem to
provide that kind of semantics. So, I am proposing creating a
ProtocolMessage class that extends DefaultMessage with these methods:
/**
* Get protocol header.
*/
public List<String> getProtocolHeader(String name) {
}
/**
* Set protocol header
*/
public void setProtocolHeader(String name, List<String> value) {
}
For example, CxfMessage will extend ProtocolMessage. If I call
CxfMessage.getProtocolHeader(), I get the protocol headers in a CXF
message not the ones that are added by CxfComponent.
CxfMessage.getHeader() is unaffected. Other message types may need to
be updated as well.
So, what do you think?
Thanks,
William