making the router optional, and allowing multiple routers
authormiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Mon, 7 Feb 2005 18:02:21 +0000 (18:02 +0000)
committermiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Mon, 7 Feb 2005 18:02:21 +0000 (18:02 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@19 9efc2488-bf62-4759-914b-345cdb29e865

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

index 931b6fc..9851b7b 100644 (file)
@@ -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();