Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

See if we can get rid of ThreadLocal usages this or other way #8644

Closed
artembilan opened this issue Jun 8, 2023 · 0 comments · Fixed by #8667
Closed

See if we can get rid of ThreadLocal usages this or other way #8644

artembilan opened this issue Jun 8, 2023 · 0 comments · Fixed by #8667
Assignees
Milestone

Comments

@artembilan
Copy link
Member

For example the RequestHandlerRetryAdvice can pass ErrorMessageUtils.FAILED_MESSAGE_CONTEXT_KEY entry as a part of callback execution or as a custom RetryCallback instance with a message passed to it.

@artembilan artembilan added this to the 6.2.x milestone Jun 8, 2023
artembilan added a commit to artembilan/spring-integration that referenced this issue Jun 14, 2023
Related to spring-projects#8644

With virtual threads it is recommended to stay away from `ThreadLocal`
variables to avoid memory exhausting with too many virtual threads

* Fix `RequestHandlerRetryAdvice` to transfer the message context via internal
`IntegrationRetryCallback` implementation.
* Cast to this `IntegrationRetryCallback` in a newly introduced internal `IntegrationRetryListener`
to extract `messageToTry` and set it into a `RetryContext`
`ErrorMessageUtils.FAILED_MESSAGE_CONTEXT_KEY` attribute
* Deprecate a usage of an external `RetryListener` implementation of the `RequestHandlerRetryAdvice`
garyrussell pushed a commit that referenced this issue Jun 21, 2023
Related to #8644

With virtual threads it is recommended to stay away from `ThreadLocal`
variables to avoid memory exhausting with too many virtual threads

* Fix `RequestHandlerRetryAdvice` to transfer the message context via internal
`IntegrationRetryCallback` implementation.
* Cast to this `IntegrationRetryCallback` in a newly introduced internal `IntegrationRetryListener`
to extract `messageToTry` and set it into a `RetryContext`
`ErrorMessageUtils.FAILED_MESSAGE_CONTEXT_KEY` attribute
* Deprecate a usage of an external `RetryListener` implementation of the `RequestHandlerRetryAdvice`
artembilan pushed a commit to artembilan/spring-integration that referenced this issue Jul 5, 2023
Fixes spring-projects#8644

* Introduce an inner `DynamicHandlerRegistrationProxy` class
to create an `IntegrationDynamicWebSocketHandlerRegistration`
and map it into a provided `WebSocketHandler` when a `dynamicHandlerMapping`
is in action.
@artembilan artembilan modified the milestones: 6.2.x, 6.2.0-M1 Jul 5, 2023
artembilan pushed a commit to artembilan/spring-integration that referenced this issue Jul 5, 2023
Fixes spring-projects#8644

* Introduce an inner `DynamicHandlerRegistrationProxy` class
to create an `IntegrationDynamicWebSocketHandlerRegistration`
and map it into a provided `WebSocketHandler` when a `dynamicHandlerMapping`
is in action.
garyrussell pushed a commit that referenced this issue Jul 13, 2023
Fixes #8644

* Introduce an inner `DynamicHandlerRegistrationProxy` class
to create an `IntegrationDynamicWebSocketHandlerRegistration`
and map it into a provided `WebSocketHandler` when a `dynamicHandlerMapping`
is in action.

Co-authored-by: pziobron <64628007+pziobron@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants