router bypassing code
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 17 Jun 2005 14:25:51 +0000 (14:25 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 17 Jun 2005 14:25:51 +0000 (14:25 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@343 9efc2488-bf62-4759-914b-345cdb29e865

src/perlmods/OpenSRF/Transport/SlimJabber/Inbound.pm

index 247326a..ccacafa 100644 (file)
@@ -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 {