From: erickson Date: Fri, 17 Jun 2005 14:25:51 +0000 (+0000) Subject: router bypassing code X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=aa28da8941ef739ce9db3d5506ae3cce096ecb31;p=opensrf%2Fbjwebb.git router bypassing code git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@343 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/perlmods/OpenSRF/Transport/SlimJabber/Inbound.pm b/src/perlmods/OpenSRF/Transport/SlimJabber/Inbound.pm index 247326a..ccacafa 100644 --- a/src/perlmods/OpenSRF/Transport/SlimJabber/Inbound.pm +++ b/src/perlmods/OpenSRF/Transport/SlimJabber/Inbound.pm @@ -102,22 +102,24 @@ sub listen { $self->{routers} = $routers; #store for destroy $self->{router_name} = $router_name; - unless($router_name and $routers) { - throw OpenSRF::EX::Config - ("Missing router config information 'router_name' and 'routers'"); - } + if($router_name and $routers) { - my @targets; - for my $router (@$routers) { - push @targets, "$router_name\@$router/router"; - } + my @targets; + for my $router (@$routers) { + push @targets, "$router_name\@$router/router"; + } + + for my $router (@targets) { + $logger->transport( $self->{app} . " connecting to router $router", INFO ); + $self->send( to => $router, + body => "registering", router_command => "register" , router_class => $self->{app} ); + } + $logger->transport( $self->{app} . " :routers connected", INFO ); + + } else { - for my $router (@targets) { - $logger->transport( $self->{app} . " connecting to router $router", INFO ); - $self->send( to => $router, - body => "registering", router_command => "register" , router_class => $self->{app} ); + $logger->transport("Bypassing routers...", INFO); } - $logger->transport( $self->{app} . " :routers connected", INFO ); } catch OpenSRF::EX::Config with {