Skip to content

Commit e69ae51

Browse files
committedNov 19, 2024·
Merge branch '6.2.x'
2 parents 8d3d0e7 + dd92eac commit e69ae51

File tree

11 files changed

+47
-45
lines changed

11 files changed

+47
-45
lines changed
 

‎framework-docs/modules/ROOT/pages/integration/jms.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ the same way as Spring's integration does for the JDBC API.
66

77
JMS can be roughly divided into two areas of functionality, namely the production and
88
consumption of messages. The `JmsTemplate` class is used for message production and
9-
synchronous message reception. For asynchronous reception similar to Jakarta EE's
9+
synchronous message receipt. For asynchronous receipt similar to Jakarta EE's
1010
message-driven bean style, Spring provides a number of message-listener containers that
1111
you can use to create Message-Driven POJOs (MDPs). Spring also provides a declarative way
1212
to create message listeners.

‎framework-docs/modules/ROOT/pages/integration/jms/receiving.adoc

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This describes how to receive messages with JMS in Spring.
55

66

77
[[jms-receiving-sync]]
8-
== Synchronous Reception
8+
== Synchronous Receipt
99

1010
While JMS is typically associated with asynchronous processing, you can
1111
consume messages synchronously. The overloaded `receive(..)` methods provide this
@@ -16,11 +16,11 @@ the receiver should wait before giving up waiting for a message.
1616

1717

1818
[[jms-receiving-async]]
19-
== Asynchronous reception: Message-Driven POJOs
19+
== Asynchronous Receipt: Message-Driven POJOs
2020

2121
NOTE: Spring also supports annotated-listener endpoints through the use of the `@JmsListener`
22-
annotation and provides an open infrastructure to register endpoints programmatically.
23-
This is, by far, the most convenient way to setup an asynchronous receiver.
22+
annotation and provides open infrastructure to register endpoints programmatically.
23+
This is, by far, the most convenient way to set up an asynchronous receiver.
2424
See xref:integration/jms/annotated.adoc#jms-annotated-support[Enable Listener Endpoint Annotations] for more details.
2525

2626
In a fashion similar to a Message-Driven Bean (MDB) in the EJB world, the Message-Driven
@@ -154,7 +154,7 @@ listener container.
154154

155155
You can activate local resource transactions through the `sessionTransacted` flag
156156
on the listener container definition. Each message listener invocation then operates
157-
within an active JMS transaction, with message reception rolled back in case of listener
157+
within an active JMS transaction, with message receipt rolled back in case of listener
158158
execution failure. Sending a response message (through `SessionAwareMessageListener`) is
159159
part of the same local transaction, but any other resource operations (such as
160160
database access) operate independently. This usually requires duplicate message
@@ -173,7 +173,7 @@ To configure a message listener container for XA transaction participation, you
173173
to configure a `JtaTransactionManager` (which, by default, delegates to the Jakarta EE
174174
server's transaction subsystem). Note that the underlying JMS `ConnectionFactory` needs to
175175
be XA-capable and properly registered with your JTA transaction coordinator. (Check your
176-
Jakarta EE server's configuration of JNDI resources.) This lets message reception as well
176+
Jakarta EE server's configuration of JNDI resources.) This lets message receipt as well
177177
as (for example) database access be part of the same transaction (with unified commit
178178
semantics, at the expense of XA transaction log overhead).
179179

‎framework-docs/modules/ROOT/pages/integration/jms/using.adoc

+8-6
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,15 @@ operations that do not refer to a specific destination.
167167

168168
One of the most common uses of JMS messages in the EJB world is to drive message-driven
169169
beans (MDBs). Spring offers a solution to create message-driven POJOs (MDPs) in a way
170-
that does not tie a user to an EJB container. (See xref:integration/jms/receiving.adoc#jms-receiving-async[Asynchronous reception: Message-Driven POJOs] for detailed
171-
coverage of Spring's MDP support.) Since Spring Framework 4.1, endpoint methods can be
172-
annotated with `@JmsListener` -- see xref:integration/jms/annotated.adoc[Annotation-driven Listener Endpoints] for more details.
170+
that does not tie a user to an EJB container. (See
171+
xref:integration/jms/receiving.adoc#jms-receiving-async[Asynchronous Receipt: Message-Driven POJOs]
172+
for detailed coverage of Spring's MDP support.) Endpoint methods can be annotated with
173+
`@JmsListener` -- see xref:integration/jms/annotated.adoc[Annotation-driven Listener Endpoints]
174+
for more details.
173175

174176
A message listener container is used to receive messages from a JMS message queue and
175177
drive the `MessageListener` that is injected into it. The listener container is
176-
responsible for all threading of message reception and dispatches into the listener for
178+
responsible for all threading of message receipt and dispatches into the listener for
177179
processing. A message listener container is the intermediary between an MDP and a
178180
messaging provider and takes care of registering to receive messages, participating in
179181
transactions, resource acquisition and release, exception conversion, and so on. This
@@ -227,7 +229,7 @@ the JMS provider, advanced functionality (such as participation in externally ma
227229
transactions), and compatibility with Jakarta EE environments.
228230

229231
You can customize the cache level of the container. Note that, when no caching is enabled,
230-
a new connection and a new session is created for each message reception. Combining this
232+
a new connection and a new session is created for each message receipt. Combining this
231233
with a non-durable subscription with high loads may lead to message loss. Make sure to
232234
use a proper cache level in such a case.
233235

@@ -246,7 +248,7 @@ in the form of a business entity existence check or a protocol table check.
246248
Any such arrangements are significantly more efficient than the alternative:
247249
wrapping your entire processing with an XA transaction (through configuring your
248250
`DefaultMessageListenerContainer` with an `JtaTransactionManager`) to cover the
249-
reception of the JMS message as well as the execution of the business logic in your
251+
receipt of the JMS message as well as the execution of the business logic in your
250252
message listener (including database operations, etc.).
251253

252254
IMPORTANT: The default `AUTO_ACKNOWLEDGE` mode does not provide proper reliability guarantees.

‎framework-docs/modules/ROOT/pages/integration/observability.adoc

+14-14
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ As outlined xref:integration/observability.adoc[at the beginning of this section
3737
|Processing time for an execution of a `@Scheduled` task
3838
|===
3939

40-
NOTE: Observations are using Micrometer's official naming convention, but Metrics names will be automatically converted
40+
NOTE: Observations use Micrometer's official naming convention, but Metrics names will be automatically converted
4141
{micrometer-docs}/concepts/naming.html[to the format preferred by the monitoring system backend]
4242
(Prometheus, Atlas, Graphite, InfluxDB...).
4343

@@ -97,7 +97,7 @@ This can be done by declaring a `SchedulingConfigurer` bean that sets the observ
9797

9898
include-code::./ObservationSchedulingConfigurer[]
9999

100-
It is using the `org.springframework.scheduling.support.DefaultScheduledTaskObservationConvention` by default, backed by the `ScheduledTaskObservationContext`.
100+
It uses the `org.springframework.scheduling.support.DefaultScheduledTaskObservationConvention` by default, backed by the `ScheduledTaskObservationContext`.
101101
You can configure a custom implementation on the `ObservationRegistry` directly.
102102
During the execution of the scheduled method, the current observation is restored in the `ThreadLocal` context or the Reactor context (if the scheduled method returns a `Mono` or `Flux` type).
103103

@@ -107,7 +107,7 @@ By default, the following `KeyValues` are created:
107107
[cols="a,a"]
108108
|===
109109
|Name | Description
110-
|`code.function` _(required)_|Name of Java `Method` that is scheduled for execution.
110+
|`code.function` _(required)_|Name of the Java `Method` that is scheduled for execution.
111111
|`code.namespace` _(required)_|Canonical name of the class of the bean instance that holds the scheduled method, or `"ANONYMOUS"` for anonymous classes.
112112
|`error` _(required)_|Class name of the exception thrown during the execution, or `"none"` if no exception happened.
113113
|`exception` _(deprecated)_|Duplicates the `error` key and might be removed in the future.
@@ -126,7 +126,7 @@ This instrumentation will create 2 types of observations:
126126
* `"jms.message.publish"` when a JMS message is sent to the broker, typically with `JmsTemplate`.
127127
* `"jms.message.process"` when a JMS message is processed by the application, typically with a `MessageListener` or a `@JmsListener` annotated method.
128128

129-
NOTE: currently there is no instrumentation for `"jms.message.receive"` observations as there is little value in measuring the time spent waiting for the reception of a message.
129+
NOTE: Currently there is no instrumentation for `"jms.message.receive"` observations as there is little value in measuring the time spent waiting for the receipt of a message.
130130
Such an integration would typically instrument `MessageConsumer#receive` method calls. But once those return, the processing time is not measured and the trace scope cannot be propagated to the application.
131131

132132
By default, both observations share the same set of possible `KeyValues`:
@@ -138,15 +138,15 @@ By default, both observations share the same set of possible `KeyValues`:
138138
|`error` |Class name of the exception thrown during the messaging operation (or "none").
139139
|`exception` _(deprecated)_|Duplicates the `error` key and might be removed in the future.
140140
|`messaging.destination.temporary` _(required)_|Whether the destination is a `TemporaryQueue` or `TemporaryTopic` (values: `"true"` or `"false"`).
141-
|`messaging.operation` _(required)_|Name of JMS operation being performed (values: `"publish"` or `"process"`).
141+
|`messaging.operation` _(required)_|Name of the JMS operation being performed (values: `"publish"` or `"process"`).
142142
|===
143143

144144
.High cardinality Keys
145145
[cols="a,a"]
146146
|===
147147
|Name | Description
148148
|`messaging.message.conversation_id` |The correlation ID of the JMS message.
149-
|`messaging.destination.name` |The name of destination the current message was sent to.
149+
|`messaging.destination.name` |The name of the destination the current message was sent to.
150150
|`messaging.message.id` |Value used by the messaging system as an identifier for the message.
151151
|===
152152

@@ -213,7 +213,7 @@ By default, the following `KeyValues` are created:
213213
|Name | Description
214214
|`error` _(required)_|Class name of the exception thrown during the exchange, or `"none"` if no exception happened.
215215
|`exception` _(deprecated)_|Duplicates the `error` key and might be removed in the future.
216-
|`method` _(required)_|Name of HTTP request method or `"none"` if not a well-known method.
216+
|`method` _(required)_|Name of the HTTP request method or `"none"` if not a well-known method.
217217
|`outcome` _(required)_|Outcome of the HTTP server exchange.
218218
|`status` _(required)_|HTTP response raw status code, or `"UNKNOWN"` if no response was created.
219219
|`uri` _(required)_|URI pattern for the matching handler if available, falling back to `REDIRECTION` for 3xx responses, `NOT_FOUND` for 404 responses, `root` for requests with no path info, and `UNKNOWN` for all other requests.
@@ -235,10 +235,10 @@ This can be done on the `WebHttpHandlerBuilder`, as follows:
235235

236236
include-code::./HttpHandlerConfiguration[]
237237

238-
It is using the `org.springframework.http.server.reactive.observation.DefaultServerRequestObservationConvention` by default, backed by the `ServerRequestObservationContext`.
238+
It uses the `org.springframework.http.server.reactive.observation.DefaultServerRequestObservationConvention` by default, backed by the `ServerRequestObservationContext`.
239239

240240
This will only record an observation as an error if the `Exception` has not been handled by an application Controller.
241-
Typically, all exceptions handled by Spring WebFlux's `@ExceptionHandler` and <<web.adoc#webflux-ann-rest-exceptions,`ProblemDetail` support>> will not be recorded with the observation.
241+
Typically, all exceptions handled by Spring WebFlux's `@ExceptionHandler` and xref:web/webflux/ann-rest-exceptions.adoc[`ProblemDetail` support] will not be recorded with the observation.
242242
You can, at any point during request processing, set the error field on the `ObservationContext` yourself:
243243

244244
include-code::./UserController[]
@@ -251,7 +251,7 @@ By default, the following `KeyValues` are created:
251251
|Name | Description
252252
|`error` _(required)_|Class name of the exception thrown during the exchange, or `"none"` if no exception happened.
253253
|`exception` _(deprecated)_|Duplicates the `error` key and might be removed in the future.
254-
|`method` _(required)_|Name of HTTP request method or `"none"` if not a well-known method.
254+
|`method` _(required)_|Name of the HTTP request method or `"none"` if not a well-known method.
255255
|`outcome` _(required)_|Outcome of the HTTP server exchange.
256256
|`status` _(required)_|HTTP response raw status code, or `"UNKNOWN"` if no response was created.
257257
|`uri` _(required)_|URI pattern for the matching handler if available, falling back to `REDIRECTION` for 3xx responses, `NOT_FOUND` for 404 responses, `root` for requests with no path info, and `UNKNOWN` for all other requests.
@@ -284,7 +284,7 @@ Instrumentation uses the `org.springframework.http.client.observation.ClientRequ
284284
[cols="a,a"]
285285
|===
286286
|Name | Description
287-
|`method` _(required)_|Name of HTTP request method or `"none"` if not a well-known method.
287+
|`method` _(required)_|Name of the HTTP request method or `"none"` if not a well-known method.
288288
|`uri` _(required)_|URI template used for HTTP request, or `"none"` if none was provided. Only the path part of the URI is considered.
289289
|`client.name` _(required)_|Client name derived from the request URI host.
290290
|`status` _(required)_|HTTP response raw status code, or `"IO_ERROR"` in case of `IOException`, or `"CLIENT_ERROR"` if no response was received.
@@ -312,7 +312,7 @@ Instrumentation uses the `org.springframework.http.client.observation.ClientRequ
312312
[cols="a,a"]
313313
|===
314314
|Name | Description
315-
|`method` _(required)_|Name of HTTP request method or `"none"` if the request could not be created.
315+
|`method` _(required)_|Name of the HTTP request method or `"none"` if the request could not be created.
316316
|`uri` _(required)_|URI template used for HTTP request, or `"none"` if none was provided. Only the path part of the URI is considered.
317317
|`client.name` _(required)_|Client name derived from the request URI host.
318318
|`status` _(required)_|HTTP response raw status code, or `"IO_ERROR"` in case of `IOException`, or `"CLIENT_ERROR"` if no response was received.
@@ -332,7 +332,7 @@ Instrumentation uses the `org.springframework.http.client.observation.ClientRequ
332332
[[observability.http-client.webclient]]
333333
=== WebClient
334334

335-
Applications must configure an `ObservationRegistry` on the `WebClient` builder to enable the instrumentation; without that, observations are "no-ops".
335+
Applications must configure an `ObservationRegistry` on the `WebClient.Builder` to enable the instrumentation; without that, observations are "no-ops".
336336
Spring Boot will auto-configure `WebClient.Builder` beans with the observation registry already set.
337337

338338
Instrumentation uses the `org.springframework.web.reactive.function.client.ClientRequestObservationConvention` by default, backed by the `ClientRequestObservationContext`.
@@ -341,7 +341,7 @@ Instrumentation uses the `org.springframework.web.reactive.function.client.Clien
341341
[cols="a,a"]
342342
|===
343343
|Name | Description
344-
|`method` _(required)_|Name of HTTP request method or `"none"` if not a well-known method.
344+
|`method` _(required)_|Name of the HTTP request method or `"none"` if not a well-known method.
345345
|`uri` _(required)_|URI template used for HTTP request, or `"none"` if none was provided. Only the path part of the URI is considered.
346346
|`client.name` _(required)_|Client name derived from the request URI host.
347347
|`status` _(required)_|HTTP response raw status code, or `"IO_ERROR"` in case of `IOException`, or `"CLIENT_ERROR"` if no response was received.

‎spring-context/src/test/java/org/springframework/context/event/test/EventCollector.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -47,7 +47,7 @@ public void addEvent(Identifiable listener, Object event) {
4747

4848
/**
4949
* Return the events that the specified listener has received. The list of events
50-
* is ordered according to their reception order.
50+
* is ordered according to the order in which they were received.
5151
*/
5252
public List<Object> getEvents(Identifiable listener) {
5353
return this.content.get(listener.getId());

‎spring-jms/src/main/java/org/springframework/jms/listener/AbstractMessageListenerContainer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -102,7 +102,7 @@
102102
* (i.e. after your business logic executed but before the JMS part got committed),
103103
* so duplicate message detection is just there to cover a corner case.
104104
* <li>Or wrap your <i>entire processing with an XA transaction</i>, covering the
105-
* reception of the JMS message as well as the execution of the business logic in
105+
* receipt of the JMS message as well as the execution of the business logic in
106106
* your message listener (including database operations etc). This is only
107107
* supported by {@link DefaultMessageListenerContainer}, through specifying
108108
* an external "transactionManager" (typically a

‎spring-jms/src/main/java/org/springframework/jms/listener/AbstractPollingMessageListenerContainer.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
*
4646
* <p>This listener container variant is built for repeated polling attempts,
4747
* each invoking the {@link #receiveAndExecute} method. The MessageConsumer used
48-
* may be reobtained fo reach attempt or cached in between attempts; this is up
48+
* may be reobtained for each attempt or cached in between attempts; this is up
4949
* to the concrete implementation. The receive timeout for each attempt can be
5050
* configured through the {@link #setReceiveTimeout "receiveTimeout"} property.
5151
*
@@ -56,7 +56,7 @@
5656
* full control over the listening process, allowing for custom scaling and throttling
5757
* and of concurrent message processing (which is up to concrete subclasses).
5858
*
59-
* <p>Message reception and listener execution can automatically be wrapped
59+
* <p>Message receipt and listener execution can automatically be wrapped
6060
* in transactions through passing a Spring
6161
* {@link org.springframework.transaction.PlatformTransactionManager} into the
6262
* {@link #setTransactionManager "transactionManager"} property. This will usually
@@ -105,7 +105,7 @@ public void setSessionTransacted(boolean sessionTransacted) {
105105

106106
/**
107107
* Specify the Spring {@link org.springframework.transaction.PlatformTransactionManager}
108-
* to use for transactional wrapping of message reception plus listener execution.
108+
* to use for transactional wrapping of message receipt plus listener execution.
109109
* <p>Default is none, not performing any transactional wrapping.
110110
* If specified, this will usually be a Spring
111111
* {@link org.springframework.transaction.jta.JtaTransactionManager} or one
@@ -131,7 +131,7 @@ public void setTransactionManager(@Nullable PlatformTransactionManager transacti
131131

132132
/**
133133
* Return the Spring PlatformTransactionManager to use for transactional
134-
* wrapping of message reception plus listener execution.
134+
* wrapping of message receipt plus listener execution.
135135
*/
136136
@Nullable
137137
protected final PlatformTransactionManager getTransactionManager() {

0 commit comments

Comments
 (0)
Please sign in to comment.