[
https://issues.apache.org/jira/browse/CAMEL-12455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16455618#comment-16455618
]
ASF GitHub Bot commented on CAMEL-12455:
----------------------------------------
WillemJiang closed pull request #2309: CAMEL-12455 - add DELIVERY_MODE to
headers
URL: https://github.com/apache/camel/pull/2309
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessageConverter.java
b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessageConverter.java
index f595848d079..6cb535e988e 100644
---
a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessageConverter.java
+++
b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessageConverter.java
@@ -78,6 +78,9 @@ public void mergeAmqpProperties(Exchange exchange,
AMQP.BasicProperties properti
if (properties.getUserId() != null) {
exchange.getIn().setHeader(RabbitMQConstants.USERID,
properties.getUserId());
}
+ if (properties.getDeliveryMode() != null) {
+ exchange.getIn().setHeader(RabbitMQConstants.DELIVERY_MODE,
properties.getDeliveryMode());
+ }
}
public AMQP.BasicProperties.Builder buildProperties(Exchange exchange) {
diff --git
a/components/camel-rabbitmq/src/test/java/org/apache/camel/component/rabbitmq/RabbitMQConsumerIntTest.java
b/components/camel-rabbitmq/src/test/java/org/apache/camel/component/rabbitmq/RabbitMQConsumerIntTest.java
index 8ea7ac068eb..1b3826b97ad 100644
---
a/components/camel-rabbitmq/src/test/java/org/apache/camel/component/rabbitmq/RabbitMQConsumerIntTest.java
+++
b/components/camel-rabbitmq/src/test/java/org/apache/camel/component/rabbitmq/RabbitMQConsumerIntTest.java
@@ -90,6 +90,21 @@ public void sentMessageIsReceived() throws
InterruptedException, IOException, Ti
to.assertIsSatisfied();
}
+ @Test
+ public void sentMessageIsDeliveryModeSet() throws InterruptedException,
IOException, TimeoutException {
+
+ to.expectedMessageCount(1);
+ to.expectedHeaderReceived(RabbitMQConstants.DELIVERY_MODE, 1);
+
+ AMQP.BasicProperties.Builder properties = new
AMQP.BasicProperties.Builder();
+ properties.deliveryMode(1);
+
+ Channel channel = connection().createChannel();
+ channel.basicPublish(EXCHANGE, "", properties.build(), MSG.getBytes());
+
+ to.assertIsSatisfied();
+ }
+
@Test
public void sentMessageWithTimestampIsReceived() throws
InterruptedException, IOException, TimeoutException {
Date timestamp = currentTimestampWithoutMillis();
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> camel-rabbitmq - Property DELIVERY_MODE is not set to exchange
> --------------------------------------------------------------
>
> Key: CAMEL-12455
> URL: https://issues.apache.org/jira/browse/CAMEL-12455
> Project: Camel
> Issue Type: Improvement
> Components: camel-rabbitmq
> Affects Versions: 2.19.4
> Reporter: Tomáš
> Priority: Minor
> Fix For: 2.22.0
>
>
> *Steps to reproduce*
> * configure camel to receive messages from rabbitmq server
> * produce / receive message
> * look into list of message properties
> *Expected result*
> There is rabbitmq.DELIVERY_MODE set to either 1 or 2 based on message
> persistance.
> *Actual result*
> The rabbitmq.DELIVERY_MODE property is missing.
> *Dev notes:*
> class: org.apache.camel.component.rabbitmq.RabbitMQMessageConverter
> method: mergeAmqpProperties
> The mapping for DELIVERY_MODE property is missing.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)