From 13f0bde989cb4c24f6ea26223f32bb99c2a0a1c6 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Thu, 11 Mar 2021 14:38:48 -0500 Subject: [PATCH] Some clean up for `jms.adoc` --- src/reference/asciidoc/jms.adoc | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/reference/asciidoc/jms.adoc b/src/reference/asciidoc/jms.adoc index 92fa9ccdfb..aec0753070 100644 --- a/src/reference/asciidoc/jms.adoc +++ b/src/reference/asciidoc/jms.adoc @@ -213,14 +213,11 @@ In that case, the attributes on the adapter are transferred to an instance of yo You can't use the Spring JMS namespace element `` to configure a container reference for the `` since that element doesn't actually reference a container. Each `` sub-element gets its own `DefaultMessageListenerContainer` (with shared attributes defined on the parent `` element). You can give each listener sub-element an `id`, and use that to inject into the channel adapter, however, the `` namespace requires a real listener. -Since, for Spring Integration, the adapter itself needs to configure the listener, the configured listener will be overwritten. -If you go this route, you will see a warning for each adapter. It is recommended to configure a regular `` for the `DefaultMessageListenerContainer` and use it as a reference in the channel adapter. ===== -IMPORTANT: Starting with version 4.2, the default `acknowledge` mode is `transacted`, unless you provide an external -container. +IMPORTANT: Starting with version 4.2, the default `acknowledge` mode is `transacted`, unless you provide an external container. In that case, you should configure the container as needed. We recommend using `transacted` with the `DefaultMessageListenerContainer` to avoid message loss. @@ -578,8 +575,7 @@ The complete correlation data is used to route the reply to the correct requesti . A `reply-destination*` property is provided a `` is provided, and `correlation-key="myCorrelationHeader"` + -The gateway has a unique correlation ID and inserts it, together with an incrementing value in the `myCorrelationHeader` -property (`gatewayId + "_" + ++seq`). +The gateway has a unique correlation ID and inserts it, together with an incrementing value in the `myCorrelationHeader` property (`gatewayId + "_" + ++seq`). The `correlation-key` can be any user-defined value. The message selector is: + @@ -609,7 +605,7 @@ If `async` is `true`, the requesting thread is released immediately after the se This can be useful when the gateway is invoked on a poller thread. The thread is released and is available for other tasks within the framework. -`async` requires a `` (or `setUseReplyContainer(true)` when using Java configuration). +Thee `async` requires a `` (or `setUseReplyContainer(true)` when using Java configuration). It also requires a `correlationKey` (usually `JMSCorrelationID`) to be specified. If either of these conditions are not met, `async` is ignored. @@ -707,7 +703,7 @@ You can use only one of those three attributes. <20> A SpEL expression evaluating to a `Destination` to which request messages are sent. The expression can result in a `Destination` object or a `String`. It is used by the `DestinationResolver` to resolve the actual `Destination`. -Oneof `reply-destination`, `reply-destination-expression`, or `reply-destination-name` is required. +One of the `reply-destination`, `reply-destination-expression`, or `reply-destination-name` is required. You can use only one of those three attributes. <21> The name of the destination to which request messages are sent. It is used by the `DestinationResolver` to resolve the actual `Destination`. @@ -891,10 +887,7 @@ myHeaderProperty = 'something' ---- ==== -Message selector expressions are a subset of the https://en.wikipedia.org/wiki/SQL-92[SQL-92] conditional expression syntax and are defined as part of the https://download.oracle.com/otn-pub/jcp/7195-jms-1.1-fr-spec-oth-JSpec/jms-1_1-fr-spec.pdf[Java Message Service] specification (Version 1.1, April 12, 2002). -Specifically, see chapter "3.8, Message Selection". -It contains a detailed explanation of the expressions syntax. - +Message selector expressions are a subset of the https://en.wikipedia.org/wiki/SQL-92[SQL-92] conditional expression syntax and are defined as part of the https://docs.oracle.com/cd/E19798-01/821-1841/bncer/index.html[Java Message Service] specification. You can specify the JMS message `selector` attribute by using XML namespace configuration for the following Spring Integration JMS components: * JMS Channel @@ -908,13 +901,13 @@ IMPORTANT: You cannot reference message body values by using JMS Message selecto [[jms-samples]] === JMS Samples -To experiment with these JMS adapters, check out the JMS samples available in the Spring Integration Samples Git repository at https://github.com/SpringSource/spring-integration-samples/tree/master/basic/jms[https://github.com/SpringSource/spring-integration-samples/tree/master/basic/jms]. +To experiment with these JMS adapters, check out the JMS samples available in the Spring Integration Samples Git repository at https://github.com/SpringSource/spring-integration-samples/tree/master/basic/jms[https://github.com/spring-projects/spring-integration-samples/tree/master/basic/jms]. That repository includes two samples. One provides inbound and outbound channel adapters, and the other provides inbound and outbound gateways. -They are configured to run with an embedded https://activemq.apache.org/[ActiveMQ] process, but you can modify the https://github.com/SpringSource/spring-integration-samples/blob/master/basic/jms/src/main/resources/META-INF/spring/integration/common.xml[common.xml] Spring application context file of each sample to support either a different JMS provider or a standalone ActiveMQ process. +They are configured to run with an embedded https://activemq.apache.org/[ActiveMQ] process, but you can modify the https://github.com/spring-projects/spring-integration-samples/blob/master/basic/jms/src/main/resources/META-INF/spring/integration/common.xml[common.xml] Spring application context file of each sample to support either a different JMS provider or a standalone ActiveMQ process. In other words, you can split the configuration so that the inbound and outbound adapters run in separate JVMs. -If you have ActiveMQ installed, modify the `brokerURL` property within the common.xml file to use `tcp://localhost:61616` (instead of `vm://localhost`). +If you have ActiveMQ installed, modify the `brokerURL` property within the `common.xml` file to use `tcp://localhost:61616` (instead of `vm://localhost`). Both of the samples accept input from stdin and echo back to stdout. Look at the configuration to see how these messages are routed over JMS.