Selaa lähdekoodia

Update hook amqp

Espinoza Guillermo 6 vuotta sitten
vanhempi
commit
ccad0fc67a
1 muutettua tiedostoa jossa 3 lisäystä ja 2 poistoa
  1. 3 2
      hooks/amqp/src/amqppublisher.cc

+ 3 - 2
hooks/amqp/src/amqppublisher.cc

@@ -5,9 +5,8 @@
 
 
 int AMQPPublisher::publish(std::string message)
 int AMQPPublisher::publish(std::string message)
 {
 {
+    AMQP amqp("amqp:5672");
     try {
     try {
-        AMQP amqp("amqp:5672");
-        
         AMQPExchange * ex = amqp.createExchange("kea");
         AMQPExchange * ex = amqp.createExchange("kea");
     
     
         ex->Declare("kea", "fanout");
         ex->Declare("kea", "fanout");
@@ -27,5 +26,7 @@ int AMQPPublisher::publish(std::string message)
         std::cout << e.getMessage() << std::endl;
         std::cout << e.getMessage() << std::endl;
     }
     }
     
     
+    amqp.closeChannel();
+    
     return 0;
     return 0;
 }
 }