Skip to content

Revise DefaultMessageListenerContainer for first-class virtual thread support #32252

Closed
@jhoeller

Description

@jhoeller

DefaultMessageListenerContainer and its base class AbstractJmsListeningContainer use synchronization for lifecycle and shared connection management. This can be replaced with ReentrantLock in order to improve virtual thread compatibility during the startup and shutdown phase. The message receive step is executing outside of a lock, so general virtual thread compatibility is given already.

Since DefaultMessageListenerContainer internally creates a SimpleAsyncTaskExecutor by default, an explicit virtual thread setup option it is also worth considering, e.g. a setVirtualThreads flag to simply pass through to the internal SimpleAsyncTaskExecutor instance.

Metadata

Metadata

Assignees

Labels

in: messagingIssues in messaging modules (jms, messaging)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions