View | Details | Raw Unified | Return to bug 35655
Collapse All | Expand All

(-)a/Koha/BackgroundJob.pm (-2 / +5 lines)
Lines 81-89 sub connect { Link Here
81
        $credentials->{passcode} = $config->{password} if $config->{password};
81
        $credentials->{passcode} = $config->{password} if $config->{password};
82
        $credentials->{host} = $config->{vhost} if $config->{vhost};
82
        $credentials->{host} = $config->{vhost} if $config->{vhost};
83
    }
83
    }
84
    my $stomp = Net::Stomp->new( { hostname => $hostname, port => $port } );
84
    
85
    my $stomp;
86
85
    try {
87
    try {
86
        $stomp = $self->connect;
88
        $stomp = Net::Stomp->new( { hostname => $hostname, port => $port } );
89
        $stomp->connect( $credentials );
87
    } catch {
90
    } catch {
88
        warn "Cannot connect to broker " . $_;
91
        warn "Cannot connect to broker " . $_;
89
        $stomp = undef;
92
        $stomp = undef;
(-)a/about.pl (-2 / +8 lines)
Lines 907-914 sub message_broker_check { Link Here
907
    {
907
    {
908
        # BackgroundJob - test connection to message broker
908
        # BackgroundJob - test connection to message broker
909
        my $conn = Koha::BackgroundJob->connect; 
909
        my $conn = Koha::BackgroundJob->connect; 
910
        if (!$conn) {
910
        if (! $conn) {
911
            $template->param( warnConnectBroker => C4::Context->preference('JobsNotificationMethod') );
911
            if (C4::Context->preference('JobsNotificationMethod') eq 'STOMP' ) {
912
                $template->param( warnConnectBroker => 'Error connecting' );
913
            } else {
914
                $template->param( 
915
                    warnConnectBroker => C4::Context->preference('JobsNotificationMethod')
916
                );
917
            }          
912
        }
918
        }
913
    }
919
    }
914
  }
920
  }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt (-2 / +3 lines)
Lines 202-208 Link Here
202
            </tr>
202
            </tr>
203
            <tr>
203
            <tr>
204
                <th scope="row">Message broker: </th>
204
                <th scope="row">Message broker: </th>
205
                [% IF warnConnectBroker %]
205
                [% IF warnConnectBroker == 'Error connecting' %]
206
                    <td class="text-bg-warning"><strong>Using SQL polling (Fallback, Error connecting to RabbitMQ)</strong></td>
207
                [% ELSIF warnConnectBroker %] 
206
                    <td class="text-bg-warning"><strong>Using SQL polling</strong></td>
208
                    <td class="text-bg-warning"><strong>Using SQL polling</strong></td>
207
                [% ELSE %]
209
                [% ELSE %]
208
                    <td class="text-bg-info">Using RabbitMQ</td>
210
                    <td class="text-bg-info">Using RabbitMQ</td>
209
- 

Return to bug 35655