We added the JobsNotificationMethod preference so people can disable the use of RabbitMQ explicitly and not get the logs flooded with connection errors. But a patch on bug 34070 reintroduced the warn ♪┏(・o・)┛♪ e2e587273c14f092d71046f21266473445b219c5
Created attachment 186506 [details] [review] Bug 40820: Fix STOMP connection warnings when JobsNotificationMethod is 'polling' The background job workers are showing STOMP/RabbitMQ connection error warnings even when the JobsNotificationMethod system preference was set to 'polling', which doesn't require a message broker connection. This patch adds checks for the JobsNotificationMethod preference before displaying connection warnings, so warnings only appear when STOMP is actually expected to be available. Changes: - misc/workers/background_jobs_worker.pl: Check syspref before warning - misc/workers/es_indexer_daemon.pl: Check syspref before warning Test plan: 1. Set JobsNotificationMethod to 'polling' 2. Run background_jobs_worker.pl - should not show STOMP warnings 3. Run es_indexer_daemon.pl - should not show STOMP warnings 4. Set JobsNotificationMethod to 'STOMP' without RabbitMQ running 5. Run workers - should show appropriate STOMP connection warnings 6. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Created attachment 186507 [details] [review] Bug 40820: (follow-up) es_indexer_daemon.pl missed on 34070 The es_indexer_daemon.pl was missing handling for the case where Koha::BackgroundJob->connect() returns undef without throwing an exception (which happens when connection fails silently). This adds the missing warning for that case, matching the behavior in background_jobs_worker.pl. Test plan: 1. Set JobsNotificationMethod to 'STOMP' 2. Configure invalid STOMP settings that cause connect() to return undef 3. Run es_indexer_daemon.pl - should show connection warning 4. Verify jobs are still processed via database polling Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>