essobedo commented on code in PR #10325:
URL: https://github.com/apache/camel/pull/10325#discussion_r1225510027


##########
components/camel-spring-rabbitmq/src/main/java/org/apache/camel/component/springrabbit/DefaultMessagePropertiesConverter.java:
##########
@@ -39,12 +41,68 @@ public DefaultMessagePropertiesConverter(CamelContext 
camelContext, HeaderFilter
     @Override
     public MessageProperties toMessageProperties(Exchange exchange) {
         MessageProperties answer = new MessageProperties();
-        String contentType = ExchangeHelper.getContentType(exchange);
+        Message message = exchange.getMessage();
+
+        Object deliveryMode = 
message.getHeader(SpringRabbitMQConstants.DELIVERY_MODE);
+        if (deliveryMode != null) {
+            answer.setDeliveryMode(deliveryMode instanceof MessageDeliveryMode 
? (MessageDeliveryMode) deliveryMode
+                    : 
MessageDeliveryMode.fromInt(Integer.parseInt(deliveryMode.toString())));
+        }
+        Object type = message.getHeader(SpringRabbitMQConstants.TYPE);
+        if (type != null) {
+            answer.setType(type.toString());

Review Comment:
   Same here, why don't you use the method 
`getHeader(SpringRabbitMQConstants.TYPE, String.class)` to trigger the type 
conversion if needed?



-- 
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