You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-ai-docs/src/main/antora/modules/ROOT/pages/api/advisors.adoc
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -62,20 +62,20 @@ The execution order of advisors in the chain is determined by the `getOrder()` m
62
62
63
63
* Advisors with lower order values are executed first.
64
64
* The advisor chain operates as a stack:
65
-
** The first advisor in the chain is the last to process the request.
66
-
** It is also the first to process the response.
65
+
** The first advisor in the chain is the first to process the request.
66
+
** It is also the last to process the response.
67
67
* To control execution order:
68
-
** Set the order close to `Ordered.HIGHEST_PRECEDENCE` to ensure an advisor is executed first in the chain (last for request processing, first for response processing).
69
-
** Set the order close to `Ordered.LOWEST_PRECEDENCE` to ensure an advisor is executed last in the chain (first for request processing, last for response processing).
68
+
** Set the order close to `Ordered.HIGHEST_PRECEDENCE` to ensure an advisor is executed first in the chain (first for request processing, last for response processing).
69
+
** Set the order close to `Ordered.LOWEST_PRECEDENCE` to ensure an advisor is executed last in the chain (last for request processing, first for response processing).
70
70
* Higher values are interpreted as lower priority.
71
71
* If multiple advisors have the same order value, their execution order is not guaranteed.
72
72
73
73
[NOTE]
74
74
====
75
75
The seeming contradiction between order and execution sequence is due to the stack-like nature of the advisor chain:
76
-
* An advisor with the highest precedence (lowest order value) is added to the bottom of the stack.
77
-
* It will be the last to process the request as the stack unwinds.
78
-
* It will be the first to process the response as the stack rewinds.
76
+
* An advisor with the highest precedence (lowest order value) is added to the top of the stack.
77
+
* It will be the first to process the request as the stack unwinds.
78
+
* It will be the last to process the response as the stack rewinds.
79
79
====
80
80
81
81
As a reminder, here are the semantics of the Spring `Ordered` interface:
0 commit comments