I’d like to add the following to the Exchange interface. default Message getMessage() { return hasOut() ? getOut() : getIn(); }
default <T> T getMessage(Class<T> type) { return hasOut() ? getOut(type) : getIn(type); } I’ve run a across the same error about a dozen times now with customers (where the work on the wrong message), and a simple addition to the Exchange interface would really help. Since this would change a core interface in Camel, I wanted to get some feedback before I made the change. Thoughts?