diff --git a/Dockerfile b/Dockerfile index eed0056..a6d0e33 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ -FROM debian -RUN apt-get update -RUN apt-get install -y make libnet-stomp-perl libanyevent-rabbitmq-perl build-essential -RUN yes | cpan install Net::MQTT::Simple -RUN yes | cpan install -f Net::RabbitMQ +FROM perl +RUN yes | cpan install Net::MQTT::Simple Net::RabbitMQ Net::Stomp +COPY bridge.pl /bridge.pl +ENTRYPOINT ["/bridge.pl"] \ No newline at end of file diff --git a/bridge.pl b/bridge.pl index 16afc3f..468f79a 100755 --- a/bridge.pl +++ b/bridge.pl @@ -102,7 +102,7 @@ while(1) { _debug("RABBIT <- " . $incoming->destination); unless($rabbit_queues{$incoming_destination}) { _debug("RABBIT Declaring queue $incoming_destination"); - $rabbit->queue_declare(1, $incoming_destination); + $rabbit->queue_declare(1, $incoming_destination, { durable => 1 }); $rabbit_queues{$incoming_destination}++; } $rabbit->publish(1, $incoming_destination, $incoming->body);