Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2bd6422

Browse files
committed
Update @⁠ConcurrencyLimit documentation
This commit updates the reference manual in order to reflect recent changes made to @⁠ConcurrencyLimit. See gh-35461 See gh-35470 See gh-35523
1 parent b9e0a48 commit 2bd6422

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎framework-docs/modules/ROOT/pages/core/resilience.adoc‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,16 @@ This is meant to protect the target resource from being accessed from too many t
9696
the same time, similar to the effect of a pool size limit for a thread pool or a
9797
connection pool that blocks access if its limit is reached.
9898

99-
You may optionally set the limit to 1, effectively locking access to the target bean
99+
You may optionally set the limit to `1`, effectively locking access to the target bean
100100
instance:
101101

102102
[source,java,indent=0,subs="verbatim,quotes"]
103103
----
104-
@ConcurrencyLimit(1) // <1>
104+
@ConcurrencyLimit(1)
105105
public void sendNotification() {
106106
this.jmsClient.destination("notifications").send(...);
107107
}
108108
----
109-
<1> 1 is the default, but specifying it makes the intent clearer.
110109

111110
Such limiting is particularly useful with Virtual Threads where there is generally no
112111
thread pool limit in place. For asynchronous tasks, this can be constrained on
@@ -116,6 +115,9 @@ For synchronous invocations, this annotation provides equivalent behavior throug
116115
which has been available since Spring Framework 1.0 for programmatic use with the AOP
117116
framework.
118117

118+
TIP: `@ConcurrencyLimit` also has a `limitString` attribute that provides property
119+
placeholder and SpEL support, as an alternative to the `int` based examples above.
120+
119121

120122
[[resilience-annotations-configuration]]
121123
== Enabling Resilient Methods

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /