This is an automated email from the ASF dual-hosted git repository. orpiske pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit c35a915834a95d93723d66c6fe74ed450be81bb4 Author: Otavio Rodolfo Piske <[email protected]> AuthorDate: Tue Mar 8 10:10:21 2022 +0100 CAMEL-15520: fixed deprecations in camel-jaxb --- .../main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java | 6 +----- .../src/test/java/org/apache/camel/jaxb/MyNotificationService.java | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java b/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java index 4a53b83..865d882 100644 --- a/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java +++ b/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java @@ -174,11 +174,7 @@ public class JaxbDataFormat extends ServiceSupport doMarshal(exchange, graph, stream, marshaller, charset); if (contentTypeHeader) { - if (exchange.hasOut()) { - exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "application/xml"); - } else { - exchange.getIn().setHeader(Exchange.CONTENT_TYPE, "application/xml"); - } + exchange.getMessage().setHeader(Exchange.CONTENT_TYPE, "application/xml"); } } catch (Exception e) { throw new IOException(e); diff --git a/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/MyNotificationService.java b/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/MyNotificationService.java index 6c7c3b4..eafb3a9 100644 --- a/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/MyNotificationService.java +++ b/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/MyNotificationService.java @@ -27,7 +27,7 @@ public class MyNotificationService { NotificationType notification = new NotificationType(); notification.setEvent("Hello"); - exchange.getOut().setBody(notification); + exchange.getMessage().setBody(notification); } public void sendNotification(Exchange exchange) {
