Skip to content

Commit ceb3dae

Browse files
committed
GH-8655: Add channel to JMS samples in doc
Fixes #8655 In the text about Outbound Channel Adapters for JMS it reads: > The following configuration produces an adapter that receives Spring Integration messages from the `exampleChannel` [...] However, the is no this channel definition in Kotlin and Java DSL snippets * Add an `exampleChannel` to Kotlin and Java DSL samples * Add Groovy DSL sample for the same flow definition
1 parent 881893d commit ceb3dae

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

src/reference/asciidoc/jms.adoc

+22-3
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ The following configuration produces an adapter that receives Spring Integration
279279
----
280280
@Bean
281281
public IntegrationFlow jmsOutboundFlow() {
282-
return f -> f
283-
.handle(Jms.outboundAdapter(cachingConnectionFactory())
282+
return IntegrationFlow.from("exampleChannel")
283+
.handle(Jms.outboundAdapter(cachingConnectionFactory())
284284
.destinationExpression("headers." + SimpMessageHeaderAccessor.DESTINATION_HEADER)
285285
.configureJmsTemplate(t -> t.id("jmsOutboundFlowTemplate")));
286286
}
@@ -290,7 +290,7 @@ public IntegrationFlow jmsOutboundFlow() {
290290
----
291291
@Bean
292292
fun jmsOutboundFlow() =
293-
integrationFlow {
293+
integrationFlow("exampleChannel") {
294294
handle(Jms.outboundAdapter(jmsConnectionFactory())
295295
.apply {
296296
destinationExpression("headers." + SimpMessageHeaderAccessor.DESTINATION_HEADER)
@@ -301,6 +301,25 @@ fun jmsOutboundFlow() =
301301
)
302302
}
303303
----
304+
[source, groovy, role="secondary"]
305+
.Groovy DSL
306+
----
307+
@Bean
308+
jmsOutboundFlow() {
309+
integrationFlow('exampleChannel') {
310+
handle(Jms.outboundAdapter(new ActiveMQConnectionFactory())
311+
.with {
312+
destinationExpression 'headers.' + SimpMessageHeaderAccessor.DESTINATION_HEADER
313+
deliveryModeFunction { DeliveryMode.NON_PERSISTENT }
314+
timeToLiveExpression '10000'
315+
configureJmsTemplate {
316+
it.explicitQosEnabled true
317+
}
318+
}
319+
)
320+
}
321+
}
322+
----
304323
[source, java, role="secondary"]
305324
.Java
306325
----

0 commit comments

Comments
 (0)