oscerd commented on PR #28968:
URL: https://github.com/apache/camel/pull/28968#issuecomment-6588439268

   Thanks, Claus.
   
   You are right about `Source`. A `DOMSource` body was published as 
`{"node":"<order id=\"1\">...</order>","systemId":null,"empty":false}`. A 
`StreamSource` with only a systemId was published as 
`{"publicId":null,"systemId":"file:...","inputStream":null,"reader":null,"empty":false}`.
 One over a Reader or an InputStream fell back to text, because Jackson cannot 
serialize the stream. With stream caching on (the default), a `StreamSource` is 
turned into a stream cache before it reaches the producer, so the 
`StreamSource` case only shows without stream caching. `isPayload` in 
`SimpleNotificationProducer` now includes `javax.xml.transform.Source`, so any 
`Source` is read as text with the type converter, which gives the XML text as 
before. I checked the DOM node too: Jackson writes it as a string, so it was 
already published as its XML text. `PublishMessageBodyTest` has three new 
tests, `domSourceIsPublishedAsXml`, `streamSourceIsPublishedAsXml` (on a route 
without stream caching) and `do
 mNodeIsPublishedAsXml`. The first two fail without the change, and the DOM 
node one passes either way. The component doc, the body types and the upgrade 
guide note now say that an XML `Source` or DOM node is published as its XML 
text.
   
   On `jackson-databind`: agreed, no explicit dependency. I took the open 
question out of the description.
   
   The nit is done. More tests read the deprecated constant than the three you 
listed: `PublishTextMessageTest`, `PublishTextMessageWithCustomEndpointTest`, 
`PublishTemplatedMessageTest`, `PublishTemplatedMessageWithCustomEndpointTest` 
and the four functional tests. They all read `SmnProperties.MESSAGE_ID` now. 
`messageIdIsStillSetInDeprecatedProperty` still covers the old name, and 
`SmnPropertiesTest` checks the value of `MESSAGE_ID` next to 
`SERVICE_MESSAGE_ID`.
   
   _Claude Code on behalf of Andrea Cosentino (oscerd)_
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to