Commit Graph

29277 Commits

Author SHA1 Message Date
Stéphane Nicoll f526b23fd7 Harmonize WebSocket message broker to use Executor
This commit harmonizes the configuration of the WebSocket message
broker to use Executor rather than TaskExecutor as only the former
is enforced. This lets custom configuration to use a wider range
of implementations.

Closes gh-32129
2024-02-15 14:59:42 +01:00
Stéphane Nicoll 2fc8b13dd5 Add support for MySQL backticks
This commit makes sure that content within backticks are skipped
when parsing a SQL statement using NamedParameterUtils. This harmonizes
the current behavior of ignoring special characters that are wrapped
in backticks.

Closes gh-31944
2024-02-15 14:41:30 +01:00
Stéphane Nicoll e73bbd4ad3 Configure jsonpath MappingProvider in WebTestClient
This commit improves jsonpath support in WebTestClient by detecting
a suitable json encoder/decoder that can be applied to assert more
complex data structure.

Closes gh-31653
2024-02-15 14:41:30 +01:00
Stéphane Nicoll 9f8038963f Allow JsonPathExpectationsHelper to use a custom configuration
This commit improves JsonPathExpectationsHelper to allow a custom json
path configuration to be defined. The primary objective of a custom
configuration is to specify a custom mapper that can deserialize complex
object structure.

As part of this commit, it is now possible to invoke a Matcher against
a type that holds generic information, using a regular
ParameterizedTypeReference.

Given that the existing constructor takes a vararg of Object, this
commit also deprecates this constructor in favor of formatting the
expression String upfront.

Closes gh-31651
2024-02-15 13:57:40 +01:00
Stéphane Nicoll 4f8eca1350 Order methods that take a type as a lambda consistently
Closes gh-32062
2024-02-15 13:57:17 +01:00
Stéphane Nicoll 18ea43c905 Allow customizations of embedded database connections
This commit allows EmbeddedDatabaseConfigurer instances to be further
customized if necessary. EmbeddedDatabaseBuilder has a way now to set
a DatabaseConfigurer rather than just a type to provide full control,
or customize an existing supported database type using the new
EmbeddedDatabaseConfigurers#customizeConfigurer callback.

Closes gh-21160
2024-02-15 13:46:49 +01:00
Stéphane Nicoll bcccba50c1 Merge branch '6.1.x' 2024-02-15 13:07:47 +01:00
Stéphane Nicoll 8288db496d Initiate Spring Framework 6.2.0 snapshots 2024-02-15 13:03:54 +01:00
Stéphane Nicoll 4230c41d97 Initiate 6.1.x branch 2024-02-15 12:59:07 +01:00
Spring Builds b082348e61 Next development version (v6.1.5-SNAPSHOT) 2024-02-15 10:22:18 +00:00
Juergen Hoeller f41c7ceaf7 Upgrade to Undertow 2.3.11 2024-02-15 10:55:28 +01:00
Juergen Hoeller 9a068869ef Upgrade to Reactor 2023.0.3, Micrometer 1.12.3, Context Propagation 1.1.1
Includes Groovy 4.0.18, Netty 4.1.107, OpenPDF 1.3.40, Protobuf 3.25.2
2024-02-15 10:13:47 +01:00
Sébastien Deleuze d147609e04 Update a reference to the build pipeline 2024-02-15 10:11:14 +01:00
Stéphane Nicoll e9a359f873
Fix pipeline reference 2024-02-15 10:08:19 +01:00
rstoyanchev 78f0688ed0 Fix javadoc error
See gh-32205
2024-02-14 16:48:58 +00:00
rstoyanchev 504b7619bd WebSocketMessageBrokerConfigurer allows to configure Lifecycle phase
Closes gh-32205
2024-02-14 16:26:33 +00:00
Brian Clozel f9ae54d91e Allow sending SSE events without data
Prior to this commit, the SseBuilder API in WebMvc.fn would only allow
to send Server-Sent Events with `data:` items in them. The spec doesnn't
disallow this and other specifications rely on such patterns to signal
the completion of a stream, like:

```
event:next
data:some data

event:complete

```

This commit adds a new `send()` method without any argument that sends
the buffered content (id, event comment and retry) without data.

Fixes: gh-32270
2024-02-14 16:58:02 +01:00
Cirus Thenter 2284254d39
Fix Kotlin syntax errors in RestClient builder example
Closes gh-32265
2024-02-14 13:52:33 +01:00
Sébastien Deleuze 6e9607ce99 Use double dot in META-INF/aop.xml documentation
Closes gh-32264
2024-02-14 10:42:15 +01:00
Arjen Poutsma b4bec4ca61 Allow repeatable writes in Client Interceptors
See gh-31449
2024-02-14 10:05:26 +01:00
Stéphane Nicoll 48da9524c3 Polish 2024-02-14 02:40:02 +01:00
Sam Brannen 68189f3de9 Document that "functions are variables" in SpEL evaluation contexts
Although EvaluationContext defines the API for setting and looking up
variables, the internals of the Spring Expression Language (SpEL)
actually provide explicit support for registering functions as
variables.

This is self-evident in the two registerFunction() variants in
StandardEvaluationContext; however, functions can also be registered as
variables when using the SimpleEvaluationContext.

Since custom functions are also viable in use cases involving the
SimpleEvaluationContext, this commit documents that functions may be
registered in a SimpleEvaluationContext via setVariable().

This commit also explicitly documents the "function as a variable"
behavior in the class-level Javadoc for both StandardEvaluationContext
and SimpleEvaluationContext, as well as in the reference manual.

Closes gh-32258
2024-02-13 17:22:35 +01:00
Sam Brannen 10bc93c058 Polishing 2024-02-13 17:22:35 +01:00
Simon Baslé 9b93c948a7 Infer reflection hints for Jackson annotations `builder` attributes
This notably enables Jackson to reflectively call a user-provided
builder class and invoke its declared methods (setters and build) in
a native app.

Closes gh-32238
2024-02-13 15:14:08 +01:00
Sébastien Deleuze abe381488a Add missing RequestPredicate variants in coRouter
Closes gh-32256
2024-02-13 14:50:49 +01:00
Sébastien Deleuze cc6dd19324 Polishing 2024-02-13 14:29:18 +01:00
Sébastien Deleuze 2fe3321813 Fix pathExtension null-safety in Kotlin DSLs
Closes gh-32254
2024-02-13 14:24:19 +01:00
Sébastien Deleuze 8c3fc8c549 Add documentation for functional resource handling
Closes gh-27257
2024-02-13 13:36:48 +01:00
Sébastien Deleuze d3ca6f9f6a Add resource redirection to WebMVC functional router
See gh-27257
2024-02-13 13:24:13 +01:00
Sébastien Deleuze 2d7b2e59b6 Add resource redirection to WebFlux functional router
See gh-27257
2024-02-13 13:24:13 +01:00
Sam Brannen 46108deff4 Make SimpleEvaluationContext.Builder final and its constructor private
Closes gh-32253
2024-02-13 13:18:54 +01:00
Sam Brannen 4454b3b5ef Polishing 2024-02-13 13:15:51 +01:00
rstoyanchev 2dd22f64e1 Improve cancellation of read/write inactivity
The cancellation of read and write inactivity tasks was done via
WebSocketHandler#afterConnectionClosed, relying on the WebSocket
library to always invoke the callback.

This change moves the cancellation to the `close` method instead
that in turn is called from DefaultStompSession#resetConnection,
in effect making the cancellation more proactive and aligned with
connection cleanup in DefaultStompSession vs relying on a
subsequent call from the WebSocket library after the connection
is closed.

Closes gh-32195
2024-02-13 11:17:34 +00:00
rstoyanchev 6be0432e3d Use ConnectionLostException after heartbeat failures
ConnectionLostException was applies only after the WebSocket library
notified us of a session close. However, read inactivity and heartbeat
send failures are also cases of the connection being lost rather than
closed intentionally.

This commit also ensures resetConnection is called after a heartbeat
write failure, consistent with other places where a transport error
is handled that implies the connection is lost.

See gh-32195
2024-02-13 11:17:34 +00:00
rstoyanchev 6a5953dca3 Polishing in WebSocketStompClient
See gh-32195
2024-02-13 11:17:34 +00:00
Juergen Hoeller b4153618a4 Consistent Lock field declaration (instead of ReentrantLock field type) 2024-02-13 11:07:20 +01:00
Juergen Hoeller 0b09f1e12f Use ReentrantLock instead of synchronization for concurrency throttle
Closes gh-32251
2024-02-13 11:03:40 +01:00
rstoyanchev 120ea0a51c Update user info pattern
Closes gh-32211
2024-02-13 07:09:46 +00:00
Stéphane Nicoll c46d6286ee Review AOT recommendations in the reference guide
This commit focuses on improving the AOT section on programmatic
registration of additional beans. This makes it more clear that a
`BeanDefinitionRegistry` must be used and that singletons are not
processed.

Closes gh-32240
Closes gh-32241
2024-02-12 16:48:26 +01:00
Arjen Poutsma 750cb73902 Introduce single-value request predicates
This commit introduces new HTTP method, Content-Type, and Accept header
request predicates that handle single values. Previously, these
predicates were always dealt with as single-value collections, which
introduced computational overhead.

Closes gh-32244
2024-02-12 16:09:00 +01:00
rstoyanchev 5851cdc679 Refine invocation of checkSessions
It makes more sense to call this from afterConnectionEstablished as it
relates to the creation of new sessions.

See gh-32195
2024-02-12 12:50:45 +00:00
Stéphane Nicoll 2e833d908a Merge pull request #32231 from OlgaMaciaszek
* pr/32231:
  Polish "Document @RequestAttribute"
  Document @RequestAttribute

Closes gh-32231
2024-02-12 10:39:00 +01:00
Stéphane Nicoll 728d5eeb74 Polish "Document @RequestAttribute"
See gh-32231
2024-02-12 10:38:29 +01:00
Olga MaciaszekSharma 89e34ae5ff Document @RequestAttribute
See gh-32231
2024-02-12 10:35:20 +01:00
Stéphane Nicoll 9ee7c6383f Merge pull request #32232 from OlgaMaciaszek
* pr/32232:
  Update copyright year of changed file
  Fix supportsRequestAttributes for RestClientAdapter

Closes gh-32232
2024-02-12 10:31:26 +01:00
Stéphane Nicoll ee801d1b28 Update copyright year of changed file
See gh-32232
2024-02-12 10:29:16 +01:00
Olga MaciaszekSharma eebdff23e7 Fix supportsRequestAttributes for RestClientAdapter
Previously, RestClientAdapter claimed that it supports request
attributes when, in fact, it does not. This commit updates the
implementation accordingly.

See gh-32232
2024-02-12 10:27:32 +01:00
Juergen Hoeller a2000dba33 Leniently accept tasks after context close in lifecycle stop phase
Schedulers remain strict, just plain executors are lenient on shutdown now.
An early shutdown for executors can be enforced via setStrictEarlyShutdown.

Closes gh-32226
2024-02-11 21:33:53 +01:00
Sam Brannen 4a3ef3e24a Document safe navigation semantics within compound expressions in SpEL
Closes gh-21827
2024-02-11 18:36:14 +01:00
Sam Brannen 4a5dc7c1b0 Document null-safe collection selection/projection support in SpEL
Closes gh-32208
2024-02-11 17:21:47 +01:00