|
38 | 38 | /** |
39 | 39 | * Default implementation of {@link AmqpHeaderMapper}. |
40 | 40 | * <p> |
41 | | - * By default this implementation will only copy AMQP properties (e.g. contentType) to and from |
| 41 | + * By default, this implementation will only copy AMQP properties (e.g. contentType) to and from |
42 | 42 | * Spring Integration MessageHeaders. Any user-defined headers within the AMQP |
43 | 43 | * MessageProperties will NOT be copied to or from an AMQP Message unless |
44 | 44 | * explicitly identified via 'requestHeaderNames' and/or 'replyHeaderNames' |
@@ -146,6 +146,8 @@ protected Map<String, Object> extractStandardHeaders(MessageProperties amqpMessa |
146 | 146 | .acceptIfHasText(AmqpHeaders.RECEIVED_USER_ID, |
147 | 147 | amqpMessageProperties.getReceivedUserId(), headers::put); |
148 | 148 |
|
| 149 | + headers.put(AmqpHeaders.RETRY_COUNT, amqpMessageProperties.getRetryCount()); |
| 150 | + |
149 | 151 | for (String jsonHeader : JsonHeaders.HEADERS) { |
150 | 152 | Object value = amqpMessageProperties.getHeaders().get(jsonHeader.replaceFirst(JsonHeaders.PREFIX, "")); |
151 | 153 | if (value instanceof String && StringUtils.hasText((String) value)) { |
@@ -205,6 +207,8 @@ protected void populateStandardHeaders(@Nullable Map<String, Object> allHeaders, |
205 | 207 | amqpMessageProperties::setDeliveryTag) |
206 | 208 | .acceptIfHasText(getHeaderIfAvailable(headers, AmqpHeaders.EXPIRATION, String.class), |
207 | 209 | amqpMessageProperties::setExpiration) |
| 210 | + .acceptIfNotNull(getHeaderIfAvailable(headers, AmqpHeaders.RETRY_COUNT, Long.class), |
| 211 | + amqpMessageProperties::setRetryCount) |
208 | 212 | .acceptIfNotNull(getHeaderIfAvailable(headers, AmqpHeaders.MESSAGE_COUNT, Integer.class), |
209 | 213 | amqpMessageProperties::setMessageCount); |
210 | 214 | String messageId = getHeaderIfAvailable(headers, AmqpHeaders.MESSAGE_ID, String.class); |
|
0 commit comments