diff --git a/Koha/BackgroundJob.pm b/Koha/BackgroundJob.pm index 99fc3bb3dd..4914971dbf 100644 --- a/Koha/BackgroundJob.pm +++ b/Koha/BackgroundJob.pm @@ -63,8 +63,10 @@ Connect to the message broker using default guest/guest credential sub connect { my ( $self ); + my $notification_method = C4::Context->preference('JobsNotificationMethod') // 'STOMP'; - return undef + + return unless $notification_method eq 'STOMP'; my $hostname = $ENV{KOHA_STOMP_HOSTNAME} // 'localhost';