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 453-457 __END_SRU_PUBLICSERVER__ Link Here
453
    <debug>__SMTP_DEBUG__</debug>
453
    <debug>__SMTP_DEBUG__</debug>
454
 </smtp_server>
454
 </smtp_server>
455
455
456
 <message_broker>
457
   <hostname>localhost</hostname>
458
   <port>61613</port>
459
   <username>guest</username>
460
   <password>guest</password>
461
   <vhost></vhost>
462
 </message_broker>
463
456
</config>
464
</config>
457
</yazgfs>
465
</yazgfs>
(-)a/etc/koha-conf.xml (-1 / +8 lines)
Lines 270-274 __PAZPAR2_TOGGLE_XML_POST__ Link Here
270
    <debug>__SMTP_DEBUG__</debug>
270
    <debug>__SMTP_DEBUG__</debug>
271
 </smtp_server>
271
 </smtp_server>
272
272
273
 <message_broker>
274
   <hostname>localhost</hostname>
275
   <port>61613</port>
276
   <username>guest</username>
277
   <password>guest</password>
278
   <vhost></vhost>
279
 </message_broker>
280
273
</config>
281
</config>
274
</yazgfs>
282
</yazgfs>
275
- 

Return to bug 26742