Skip to content

Refactor EurekaServerInitializerConfiguration#4571

Open
alihsan-tsdln wants to merge 2 commits into
spring-cloud:mainfrom
alihsan-tsdln:main
Open

Refactor EurekaServerInitializerConfiguration#4571
alihsan-tsdln wants to merge 2 commits into
spring-cloud:mainfrom
alihsan-tsdln:main

Conversation

@alihsan-tsdln
Copy link
Copy Markdown

Replace the raw 'new Thread' creation with
CompletableFuture.runAsync() to align with modern
Java concurrency practices.

Consolidate field injection and ServletContextAware
into a single constructor. Add the volatile keyword
to the 'running' flag to ensure thread visibility
across the container. Inject ApplicationEventPublisher
instead of the full ApplicationContext to improve
interface segregation.

Fixes gh-4570

Ali Ihsan TASDELEN added 2 commits May 21, 2026 11:24
Replace the raw 'new Thread' creation with
CompletableFuture.runAsync() to align with modern
Java concurrency practices.

Consolidate field injection and ServletContextAware
into a single constructor. Add the volatile keyword
to the 'running' flag to ensure thread visibility
across the container. Inject ApplicationEventPublisher
instead of the full ApplicationContext to improve
interface segregation.

Fixes spring-cloudgh-4570

Signed-off-by: Ali Ihsan TASDELEN <alihsan.tsdln@gmail.com>
Replace the raw 'new Thread' creation with
CompletableFuture.runAsync() to align with modern
Java concurrency practices.

Consolidate field injection and ServletContextAware
into a single constructor. Add the volatile keyword
to the 'running' flag to ensure thread visibility
across the container. Inject ApplicationEventPublisher
instead of the full ApplicationContext to improve
interface segregation.

Fixes spring-cloudgh-4570

Signed-off-by: Ali Ihsan TASDELEN <alihsan.tsdln@gmail.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 this pull request may close these issues.

Refactoring, thread-safety, and DI improvements in EurekaServerInitializerConfiguration

2 participants