You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* GH-3089: Add AmqpInGateway.replyHeadersMappedLast
Fixes#3089
In some use-case we would like to control when headers from SI message
should be populated into an AMQP message.
One of the use-case is like a `SimpleMessageConverter` and its `plain/text`
for the String reply, meanwhile we know that this content is an
`application/json`.
So, with a new `replyHeadersMappedLast` we can override the mentioned
`content-type` header, populated by the `MessageConverter` with an
actual value from the message headers populated in the flow upstream
* Introduce an `AmqpInboundGateway.replyHeadersMappedLast`; expose it
on the DSL and XML level
* Use newly introduced `MappingUtils.mapReplyMessage()`
* Optimize `DefaultAmqpHeaderMapper` to not parse JSON headers at all
when `JsonHeaders.TYPE_ID` is already present (e.g. `MessageConverter`
result)
* Also skip `JsonHeaders` when we `populateUserDefinedHeader()`
**Cherry-pick to 5.1.x**
* * Fix language and package typos
* Add missed `@param` in JavaDoc of the `AmqpBaseInboundGatewaySpec.batchingStrategy()`
* Extract a `RabbitTemplate` `MessageConverter` to use for reply messages
conversion - pursue a backward compatibility
Copy file name to clipboardExpand all lines: spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpInboundGatewayParser.java
Copy file name to clipboardExpand all lines: spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/AmqpBaseInboundGatewaySpec.java
+25Lines changed: 25 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -138,4 +138,29 @@ public S recoveryCallback(RecoveryCallback<?> recoveryCallback) {
138
138
return_this();
139
139
}
140
140
141
+
/**
142
+
* Set to true to bind the source message in the headers.
Copy file name to clipboardExpand all lines: spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundGateway.java
Copy file name to clipboardExpand all lines: spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapper.java
Copy file name to clipboardExpand all lines: spring-integration-amqp/src/main/resources/org/springframework/integration/amqp/config/spring-integration-amqp-5.1.xsd
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -239,6 +239,18 @@
239
239
</xsd:documentation>
240
240
</xsd:annotation>
241
241
</xsd:attribute>
242
+
<xsd:attributename="reply-headers-last">
243
+
<xsd:annotation>
244
+
<xsd:documentation>
245
+
Whether reply headers are mapped before or after conversion from a messaging Message to
246
+
a spring amqp Message. Set to true, for example, if you wish to override the
0 commit comments