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
JMS-in-gateway: destination to requestDestination (#3494)
* JMS-in-gateway: destination to requestDestination
Related to https://stackoverflow.com/questions/66174779/what-is-the-dsl-version-of-int-jmsinbound-gateway-request-destination
In Java DSL, the `JmsInboundGatewaySpec` expose a `destination()` option which is not correlated
what we have in XML with a `request-destination` and what we have with a `replyQueue` option
* Deprecate an existing `destination()` option in the `JmsInboundGatewaySpec`
in favor of newly introduced `requestDestination()`
* Clean up a bit `jms.adoc` and add some code block-switch sections to show
Java & Kotlin DSLs along side with existing XML configs
* Fix typo.
Co-authored-by: Gary Russell <[email protected]>
@@ -72,19 +108,7 @@ However, if your JMS `ConnectionFactory` has a different bean name, you need to
72
108
If `extract-payload` is set to `true` (the default), the received JMS Message is passed through the `MessageConverter`.
73
109
When relying on the default `SimpleMessageConverter`, this means that the resulting Spring Integration Message has the JMS message's body as its payload.
74
110
A JMS `TextMessage` produces a string-based payload, a JMS `BytesMessage` produces a byte array payload, and the serializable instance of a JMS `ObjectMessage` becomes the Spring Integration message's payload.
75
-
If you prefer to have the raw JMS message as the Spring Integration message's payload, set `extract-payload` to `false`, as the following example shows:
76
-
77
-
====
78
-
[source,xml]
79
-
----
80
-
<int-jms:inbound-channel-adapter id="jmsIn"
81
-
destination="inQueue"
82
-
channel="exampleChannel"
83
-
extract-payload="false"/>
84
-
<int:poller fixed-rate="30000"/>
85
-
</int-jms:inbound-channel-adapter>
86
-
----
87
-
====
111
+
If you prefer to have the raw JMS message as the Spring Integration message's payload, set the `extractPayload` option to `false`.
88
112
89
113
Starting with version 5.0.8, a default value of the `receive-timeout` is `-1` (no wait) for the `org.springframework.jms.connection.CachingConnectionFactory` and `cacheConsumers`, otherwise it is 1 second.
90
114
The JMS Inbound Channel Adapter crates a `DynamicJmsTemplate` based on the provided `ConnectionFactory` and options.
@@ -119,7 +143,54 @@ The `message-driven-channel-adapter` requires a reference to either an instance
119
143
The following example defines a message-driven channel adapter with a `Destination` reference:
120
144
121
145
====
122
-
[source,xml]
146
+
[source, java, role="primary"]
147
+
.Java DSL
148
+
----
149
+
@Bean
150
+
public IntegrationFlow jmsMessageDrivenRedeliveryFlow() {
@@ -203,7 +274,46 @@ As with the inbound channel adapter, the easiest way to configure this adapter i
203
274
The following configuration produces an adapter that receives Spring Integration messages from the `exampleChannel`, converts those into JMS messages, and sends them to the JMS destination reference whose bean name is `outQueue`:
Similarly, for an inbound-gateway, the 'extract-reply-payload' property applies to the Spring Integration message that is to be converted into a reply JMS Message.
265
375
If you want to pass the whole Spring Integration message (as the body of a JMS ObjectMessage), set value this to 'false'.
266
-
By default, it is also 'true' that the Spring Integration message payload is converted into a JMS Message (for example, a
267
-
`String` payload becomes a JMS TextMessage).
376
+
By default, it is also 'true' that the Spring Integration message payload is converted into a JMS Message (for example, a `String` payload becomes a JMS TextMessage).
268
377
269
378
As with anything else, gateway invocation might result in error.
270
379
By default, a producer is not notified of the errors that might have occurred on the consumer side and times out waiting for the reply.
@@ -306,7 +415,7 @@ To revert to the previous behavior, set the `shutdownContainerOnStop` on the `Jm
306
415
=== Outbound Gateway
307
416
308
417
The outbound gateway creates JMS messages from Spring Integration messages and sends them to a 'request-destination'.
309
-
It thens handle the JMS reply message either by using a selector to receive from the 'reply-destination' that you configure or, if no 'reply-destination' is provided, by creating JMS `TemporaryQueue` instances.
418
+
It then handles the JMS reply message either by using a selector to receive from the 'reply-destination' that you configure or, if no 'reply-destination' is provided, by creating JMS `TemporaryQueue` instances.
0 commit comments