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

(-)a/Koha/BackgroundJob.pm (-2 / +22 lines)
Lines 62-69 Connect to the message broker using default guest/guest credential Link Here
62
62
63
sub connect {
63
sub connect {
64
    my ( $self );
64
    my ( $self );
65
    my $stomp = Net::Stomp->new( { hostname => 'localhost', port => '61613' } );
65
    my $hostname = 'localhost';
66
    $stomp->connect( { login => 'guest', passcode => 'guest' } );
66
    my $port = '61613';
67
    my $config = C4::Context->config('message_broker');
68
    my $credentials = {
69
        login => 'guest',
70
        passcode => 'guest',
71
    };
72
    if ($config){
73
        $hostname = $config->{hostname} if $config->{hostname};
74
        $port = $config->{port} if $config->{port};
75
        $credentials->{login} = $config->{username} if $config->{username};
76
        $credentials->{passcode} = $config->{password} if $config->{password};
77
        $credentials->{host} = $config->{vhost} if $config->{vhost};
78
    }
79
    my $stomp = Net::Stomp->new( { hostname => $hostname, port => $port } );
80
    my $frame = $stomp->connect( $credentials );
81
    unless ($frame && $frame->command eq 'CONNECTED'){
82
        if ($frame){
83
            warn $frame->as_string;
84
        }
85
        die "Cannot connect to message broker";
86
    }
67
    return $stomp;
87
    return $stomp;
68
}
88
}
69
89
(-)a/debian/templates/koha-conf-site.xml.in (+8 lines)
Lines 455-459 __END_SRU_PUBLICSERVER__ Link Here
455
    <debug>__SMTP_DEBUG__</debug>
455
    <debug>__SMTP_DEBUG__</debug>
456
 </smtp_server>
456
 </smtp_server>
457
457
458
 <message_broker>
459
   <hostname>localhost</hostname>
460
   <port>61613</port>
461
   <username>guest</username>
462
   <password>guest</password>
463
   <vhost></vhost>
464
 </message_broker>
465
458
</config>
466
</config>
459
</yazgfs>
467
</yazgfs>
(-)a/etc/koha-conf.xml (-1 / +8 lines)
Lines 272-276 __PAZPAR2_TOGGLE_XML_POST__ Link Here
272
    <debug>__SMTP_DEBUG__</debug>
272
    <debug>__SMTP_DEBUG__</debug>
273
 </smtp_server>
273
 </smtp_server>
274
274
275
 <message_broker>
276
   <hostname>localhost</hostname>
277
   <port>61613</port>
278
   <username>guest</username>
279
   <password>guest</password>
280
   <vhost></vhost>
281
 </message_broker>
282
275
</config>
283
</config>
276
</yazgfs>
284
</yazgfs>
277
- 

Return to bug 26742