Skip to content

Add logging operators in DefaultExchangeFunction only when debug is enabled - #37095

Merged
bclozel merged 1 commit into
spring-projects:mainfrom
samueldlightfoot:perf/exchange-functions-debug-gating
Aug 5, 2026
Merged

Add logging operators in DefaultExchangeFunction only when debug is enabled#37095
bclozel merged 1 commit into
spring-projects:mainfrom
samueldlightfoot:perf/exchange-functions-debug-gating

Conversation

@samueldlightfoot

Copy link
Copy Markdown
Contributor

DefaultExchangeFunction.exchange added doOnRequest/doOnCancel logging operators unconditionally, which costs two subscriber wrappers per request even though the log message construction itself is already guarded lazily. Gate the operators on isDebugEnabled(), checked per exchange so runtime log level changes are still honored.

@samueldlightfoot
samueldlightfoot force-pushed the perf/exchange-functions-debug-gating branch from dcc7871 to 5a3f11f Compare July 30, 2026 19:05
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 30, 2026
@bclozel bclozel self-assigned this Aug 5, 2026
Prior to this commit, `DefaultExchangeFunction.exchange` added
logging operations within `doOnRequest`/`doOnCancel` operators
unconditionally, which costs two subscriber wrappers per request
even though the log message construction itself is already
guarded lazily. This commit gates the operators on `isDebugEnabled()`,
checked per exchange so runtime log level changes are still honored.

Signed-off-by: samlightfoot <samueldlightfoot@gmail.com>
@bclozel
bclozel force-pushed the perf/exchange-functions-debug-gating branch from 5a3f11f to 595c246 Compare August 5, 2026 15:00
@bclozel bclozel added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Aug 5, 2026
@bclozel bclozel added this to the 7.1.0-M1 milestone Aug 5, 2026
@bclozel
bclozel merged commit 595c246 into spring-projects:main Aug 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants