Bugzilla – Attachment 117533 Details for
Bug 26742
Add configuration for message broker
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26742: Add configuration to koha-conf.xml for message broker
Bug-26742-Add-configuration-to-koha-confxml-for-me.patch (text/plain), 3.05 KB, created by
Martin Renvoize (ashimema)
on 2021-03-02 16:50:59 UTC
(
hide
)
Description:
Bug 26742: Add configuration to koha-conf.xml for message broker
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-03-02 16:50:59 UTC
Size:
3.05 KB
patch
obsolete
>From c9fe565275f5c504442f93ae74251671d18b1df6 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 20 Oct 2020 11:54:46 +1100 >Subject: [PATCH] Bug 26742: Add configuration to koha-conf.xml for message > broker > >The connection details for the message broker should be configurable. >This patch adds configuration options to koha-conf.xml. If they >are not specified, then default connection details will be used. > >Signed-off-by: Michal Denar <black23@gmail.com> >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/BackgroundJob.pm | 24 ++++++++++++++++++++++-- > debian/templates/koha-conf-site.xml.in | 8 ++++++++ > etc/koha-conf.xml | 8 ++++++++ > 3 files changed, 38 insertions(+), 2 deletions(-) > >diff --git a/Koha/BackgroundJob.pm b/Koha/BackgroundJob.pm >index d375dfa0d5..1a25c32721 100644 >--- a/Koha/BackgroundJob.pm >+++ b/Koha/BackgroundJob.pm >@@ -62,8 +62,28 @@ Connect to the message broker using default guest/guest credential > > sub connect { > my ( $self ); >- my $stomp = Net::Stomp->new( { hostname => 'localhost', port => '61613' } ); >- $stomp->connect( { login => 'guest', passcode => 'guest' } ); >+ my $hostname = 'localhost'; >+ my $port = '61613'; >+ my $config = C4::Context->config('message_broker'); >+ my $credentials = { >+ login => 'guest', >+ passcode => 'guest', >+ }; >+ if ($config){ >+ $hostname = $config->{hostname} if $config->{hostname}; >+ $port = $config->{port} if $config->{port}; >+ $credentials->{login} = $config->{username} if $config->{username}; >+ $credentials->{passcode} = $config->{password} if $config->{password}; >+ $credentials->{host} = $config->{vhost} if $config->{vhost}; >+ } >+ my $stomp = Net::Stomp->new( { hostname => $hostname, port => $port } ); >+ my $frame = $stomp->connect( $credentials ); >+ unless ($frame && $frame->command eq 'CONNECTED'){ >+ if ($frame){ >+ warn $frame->as_string; >+ } >+ die "Cannot connect to message broker"; >+ } > return $stomp; > } > >diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in >index d6ebd44498..99abe452a9 100644 >--- a/debian/templates/koha-conf-site.xml.in >+++ b/debian/templates/koha-conf-site.xml.in >@@ -441,5 +441,13 @@ __END_SRU_PUBLICSERVER__ > <debug>__SMTP_DEBUG__</debug> > </smtp_server> > >+ <message_broker> >+ <hostname>localhost</hostname> >+ <port>61613</port> >+ <username>guest</username> >+ <password>guest</password> >+ <vhost></vhost> >+ </message_broker> >+ > </config> > </yazgfs> >diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml >index c5f827ba8d..118b6b8207 100644 >--- a/etc/koha-conf.xml >+++ b/etc/koha-conf.xml >@@ -258,5 +258,13 @@ > <debug>__SMTP_DEBUG__</debug> > </smtp_server> > >+ <message_broker> >+ <hostname>localhost</hostname> >+ <port>61613</port> >+ <username>guest</username> >+ <password>guest</password> >+ <vhost></vhost> >+ </message_broker> >+ > </config> > </yazgfs> >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26742
:
112013
|
112015
|
113906
|
114288
|
114372
| 117533 |
117534