Idiot
[catagits/Catalyst-Engine-STOMP.git] / lib / Catalyst / Engine / Stomp.pm
index 218702e..d38af96 100644 (file)
@@ -77,6 +77,10 @@ sub run {
 
         # connect up
         my %template = %{$app->config->{'Engine::Stomp'}};
+        my $subscribe_headers = $template{subscribe_headers} || {};
+        die("subscribe_headers config for Engine::Stomp must be a hashref!\n")
+            if (ref($subscribe_headers) ne 'HASH');
+
         $self->connection(Net::Stomp->new(\%template));
         $self->connection->connect();
         $self->conn_desc($template{hostname}.':'.$template{port});
@@ -85,9 +89,10 @@ sub run {
         foreach my $queue (@queues) {
                 my $queue_name = "/queue/$queue";
                 $self->connection->subscribe({
-                                              destination => $queue_name,
-                                              ack         => 'client'
-                                             });
+                    %$subscribe_headers,
+                    destination => $queue_name,
+                    ack         => 'client',
+                });
         }
 
         # enter loop...