We are marshaling JMS messages to XmlBeans objects using a channel interceptor. We then want to route the message using the xpath router. unfortunately it appears the DefaultXmlPayloadConverter does not convert XmlBeans XmlObject to a Node object and therefore the xpath router does not execute.
It looks like it could be accomplished by modifying DefaultXmlPayloadConverter to include additional condition for XmlObject as show below. I am sure there is a more elegant solution and their may need more thought if additional marshalling frameworks need support. Allowing the set a custom XmlPayloadConverter on the xpath router in config could help as well so that the entire xpath route bean definitions does not have to be created in order to set.
Code:public Node convertToNode(Object object) { Node node = null; if (object instanceof Node) { node = (Node) object; } else if (object instanceof DOMSource) { node = ((DOMSource) object).getNode(); } else if (object instanceof XmlObject){ node = ((XmlObject)object).newDomNode(); } else { node = convertToDocument(object); } return node; }


Reply With Quote