This plugin allows you to publish messages to RabbitMQ from HSL.
Follow the instructions in our manual to add our package repository and then run the below command.
apt-get install halon-extras-rabbitmq
yum install halon-extras-rabbitmq
These functions needs to be imported from the extras://rabbitmq
module path.
Params
- message_body
string
(required) - options
array
- hostname
string
(default"localhost"
) - port
number
(default5672
) - connect_timeout
number
(default10
) - vhost
string
(default"/"
) - username
string
(default"guest"
) - password
string
(default"guest"
) - exchange
string
(default"amq.direct"
) - routing_key
string
(default""
) - content_type
string
(default"text/plain"
) - delivery_mode
string
(default"nonpersistent"
) - tls_enabled
boolean
(defaultfalse
) - tls_verify_peer
boolean
(defaultfalse
) - tls_verify_host
boolean
(defaultfalse
)
- hostname
Returns
An associative array with a result
key (if the message was successfully published) or a error
key (if an error occurred).
Example
import { rabbitmq_publish } from "extras://rabbitmq";
rabbitmq_publish("hello world", [
"hostname" => "localhost",
"port" => 5672,
"connect_timeout" => 10,
"vhost" => "/",
"username" => "guest",
"password" => "guest",
"exchange" => "amq.direct",
"routing_key" => "",
"content_type" => "text/plain",
"delivery_mode" => "nonpersistent",
"tls_enabled" => false,
"tls_verify_peer" => false,
"tls_verify_host" => false
]);