spring-projects / spring-modulith

Modular applications with Spring Boot
https://spring.io/projects/spring-modulith
Apache License 2.0
786 stars 131 forks source link

Use dedicated task executor for `@ApplicationModuleListener`s #641

Open odrotbohm opened 4 months ago

odrotbohm commented 4 months ago

@ApplicationModuleListeners need dedicated control over the Executor running them, for example, to enable tracing context propagation in the observability module. To contain the impact of such a customization, it makes sense to use a dedicated Executor.

Implementation considerations

References

danstooamerican commented 4 months ago

Will it be possible to configure the Executor or extend its functionality? Our application configures a custom TaskDecorator. Currently, we use a custom aspect to get the same functionality for @ApplicationModuleListener.

odrotbohm commented 4 months ago

Yes, you'll be able to override the bean by name. Or use a BeanPostProcessor to find and customize it.