From 12239c786f29386cb2b4dbb4e7e0d27274e409b0 Mon Sep 17 00:00:00 2001 From: miker Date: Mon, 7 Feb 2005 18:02:21 +0000 Subject: [PATCH] making the router optional, and allowing multiple routers git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@19 9efc2488-bf62-4759-914b-345cdb29e865 --- src/perlmods/OpenSRF/Transport/SlimJabber/Inbound.pm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/perlmods/OpenSRF/Transport/SlimJabber/Inbound.pm b/src/perlmods/OpenSRF/Transport/SlimJabber/Inbound.pm index 931b6fc..9851b7b 100644 --- a/src/perlmods/OpenSRF/Transport/SlimJabber/Inbound.pm +++ b/src/perlmods/OpenSRF/Transport/SlimJabber/Inbound.pm @@ -39,8 +39,11 @@ This service should be loaded at system startup. my $username = $config->transport->users->$app; my $password = $config->transport->auth->password; - my $resource = "system_" . $config->env->hostname . "_$$"; + my $resource = 'system'; + if (defined $config->system->router_target) { + $resource .= '_' . $config->env->hostname . "_$$"; + } my $self = __PACKAGE__->SUPER::new( username => $username, @@ -65,9 +68,13 @@ sub listen { my $self = shift; my $config = OpenSRF::Utils::Config->current; - my $router = $config->system->router_target; - $self->send( to => $router, - body => "registering", router_command => "register" , router_class => $self->{app} ); + my $routers = $config->system->router_target; + if (defined $routers) { + for my $router (@$routers) P + $self->send( to => $router, + body => "registering", router_command => "register" , router_class => $self->{app} ); + } + } while(1) { my $sock = $self->unix_sock(); -- 2.11.0