This commit is contained in:
Matthew Slowe 2021-01-17 16:35:17 +00:00
parent 064e7cf716
commit 618bc5d76c
2 changed files with 5 additions and 6 deletions

View File

@ -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"]

View File

@ -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);