fix(system): avoid creating multiple worker job queue

We created miltiple worker job queue because the bean was in the prototype scope.
This was needed only for tests as they are closing it.
Switching to singleton and rebuilding the context of the test that needs it fixes the issue.
This commit is contained in:
Loïc Mathieu
2025-07-03 16:43:47 +02:00
parent 2109fa8116
commit 6a4397fdfd
8 changed files with 22 additions and 23 deletions

View File

@@ -42,7 +42,7 @@ public class H2QueueFactory implements QueueFactoryInterface {
}
@Override
@Prototype // must be prototype so we can create two Worker in the same application context for testing purpose.
@Singleton
@Named(QueueFactoryInterface.WORKERJOB_NAMED)
@Bean(preDestroy = "close")
public QueueInterface<WorkerJob> workerJob() {