AMQP
amqp declare_exchangeamqp declare_exchangeamqp declare_queueamqp declare_queueamqp bindamqp publishamqp publishamqp publish_batchamqp publish_batchamqp queue_infoamqp consumeamqp consumeamqp purgeamqp delete_queueamqp test
amqp declare_exchange <config> <exchange> <type>
Description
Declare a durable exchange of a type: direct, fanout, topic, headers or x-. Returns {exchange, type}
Declare a durable exchange of a type: direct, fanout, topic, headers or x-
Parameters
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
exchange: The name of the exchange - String - required
type: The type of the exchange - String - required
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
exchange: The name of the exchange - String - required
type: The type of the exchange - String - required
admin
amqp declare_exchange "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "orders" "direct"
mentdb
{"exchange": "orders", "type": "direct"}
amqp declare_exchange <config> <exchange> <type> <json_params>
Description
Declare an exchange with parameters: durable (true), auto_delete (false), internal (false), arguments (a JSON object)
Declare an exchange with parameters: durable (true), auto_delete (false), internal (false), arguments (a JSON object)
Parameters
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
exchange: The name of the exchange - String - required
type: The type of the exchange - String - required
json_params: The parameters - String - required
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
exchange: The name of the exchange - String - required
type: The type of the exchange - String - required
json_params: The parameters - String - required
admin
amqp declare_exchange "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "news" "fanout" "{\"durable\": false, \"auto_delete\": true}"
mentdb
{"exchange": "news", "type": "fanout"}
amqp declare_queue <config> <queue>
Description
Declare a durable queue. An empty name asks the broker for a name. Returns {queue, messages, consumers}
Declare a durable queue. An empty name asks the broker for a name. Returns {queue, messages, consumers}
Parameters
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
queue: The name of the queue, at most 255 bytes in UTF-8 - String - required
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
queue: The name of the queue, at most 255 bytes in UTF-8 - String - required
admin
amqp declare_queue "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "orders.eu"
mentdb
{"queue": "orders.eu", "messages": 0, "consumers": 0}
with a URI (fixed result: a real local Apache Qpid Broker-J 9.2.0, not RabbitMQ)
admin
amqp declare_queue "{\"uri\": \"amqp://guest:guest@127.0.0.1:25672/%2f\", \"timeout_ms\": 3000}" "orders.us"
mentdb
{"queue": "orders.us", "messages": 0, "consumers": 0}
amqp declare_queue <config> <queue> <json_params>
Description
Declare a queue with parameters: durable (true), exclusive (false), auto_delete (false), arguments (a JSON object; their names depend on the broker: x-message-ttl on RabbitMQ is refused by Qpid Broker-J)
Declare a queue with parameters: durable (true), exclusive (false), auto_delete (false), arguments (a JSON object; their names depend on the broker: x-message-ttl on RabbitMQ is refused by Qpid Broker-J)
Parameters
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
queue: The name of the queue, at most 255 bytes in UTF-8 - String - required
json_params: The parameters - String - required
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
queue: The name of the queue, at most 255 bytes in UTF-8 - String - required
json_params: The parameters - String - required
admin
amqp declare_queue "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "orders.tmp" "{\"arguments\": {\"x-qpid-priorities\": 5}}"
mentdb
{"queue": "orders.tmp", "messages": 0, "consumers": 0}
amqp bind <config> <queue> <exchange> <routing_key>
Description
Bind a queue to an exchange. Returns {queue, exchange, routing_key}
Bind a queue to an exchange. Returns {queue, exchange, routing_key}
Parameters
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
queue: The name of the queue, at most 255 bytes in UTF-8 - String - required
exchange: The name of the exchange - String - required
routing_key: The routing key, at most 255 bytes in UTF-8 - String - required
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
queue: The name of the queue, at most 255 bytes in UTF-8 - String - required
exchange: The name of the exchange - String - required
routing_key: The routing key, at most 255 bytes in UTF-8 - String - required
admin
amqp bind "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "orders.eu" "orders" "eu.new"
mentdb
{"queue": "orders.eu", "exchange": "orders", "routing_key": "eu.new"}
amqp publish <config> <exchange> <routing_key> <body>
Description
Publish a persistent text and wait for the publisher confirm. Returns {confirmed, returned}
Publish a persistent text and wait for the publisher confirm. Returns {confirmed, returned}
Parameters
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
exchange: The name of the exchange, at most 255 bytes in UTF-8 (empty for a publish: the default exchange, where the routing key is the name of a queue) - String - required
routing_key: The routing key, at most 255 bytes in UTF-8 - String - required
body: The text, sent in UTF-8 - String - required
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
exchange: The name of the exchange, at most 255 bytes in UTF-8 (empty for a publish: the default exchange, where the routing key is the name of a queue) - String - required
routing_key: The routing key, at most 255 bytes in UTF-8 - String - required
body: The text, sent in UTF-8 - String - required
admin
amqp publish "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "orders" "eu.new" "order 1"
mentdb
{"confirmed": true, "returned": false}
directly to a queue by the default exchange (fixed result: a real local Apache Qpid Broker-J 9.2.0, not RabbitMQ)
admin
amqp publish "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "" "orders.us" "order 2"
mentdb
{"confirmed": true, "returned": false}
amqp publish <config> <exchange> <routing_key> <body> <json_params>
Description
Publish with parameters: content_type, headers (a JSON object), persistent (true), mandatory (false), confirm (true), message_id, correlation_id, encoding (utf-8, or base64: the body is decoded and sent as bytes). A returned message adds reply_code and reply_text, a refused one nacked true
Publish with parameters: content_type, headers (a JSON object), persistent (true), mandatory (false), confirm (true), message_id, correlation_id, encoding (utf-8, or base64: the body is decoded and sent as bytes). A returned message adds reply_code and reply_text, a refused one nacked true
Parameters
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
exchange: The name of the exchange, at most 255 bytes in UTF-8 (empty for a publish: the default exchange, where the routing key is the name of a queue) - String - required
routing_key: The routing key, at most 255 bytes in UTF-8 - String - required
body: The text or the base64 - String - required
json_params: The parameters - String - required
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
exchange: The name of the exchange, at most 255 bytes in UTF-8 (empty for a publish: the default exchange, where the routing key is the name of a queue) - String - required
routing_key: The routing key, at most 255 bytes in UTF-8 - String - required
body: The text or the base64 - String - required
json_params: The parameters - String - required
admin
amqp publish "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "orders" "eu.new" "{\"id\": 3}" "{\"content_type\": \"application/json\", \"headers\": {\"source\": \"erp\", \"try\": 1}, \"message_id\": \"m-3\", \"correlation_id\": \"c-3\"}"
mentdb
{"confirmed": true, "returned": false}
no queue for this key, with a confirm: refused by this broker (fixed result: a real local Apache Qpid Broker-J 9.2.0, not RabbitMQ)
admin
amqp publish "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "orders" "asia.new" "order 4" "{\"mandatory\": true}"
mentdb
{"confirmed": false, "returned": false, "nacked": true}
no queue for this key, without a confirm: returned (fixed result: a real local Apache Qpid Broker-J 9.2.0, not RabbitMQ)
admin
amqp publish "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "orders" "asia.new" "order 4" "{\"mandatory\": true, \"confirm\": false}"
mentdb
{"confirmed": false, "returned": true, "reply_code": 312, "reply_text": "No route for message with exchange 'orders' and routing key 'asia.new'"}
without a confirm (fixed result: a real local Apache Qpid Broker-J 9.2.0, not RabbitMQ)
admin
amqp publish "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "orders" "eu.new" "order 5" "{\"confirm\": false, \"persistent\": false}"
mentdb
{"confirmed": false, "returned": false}
amqp publish_batch <config> <exchange> <json_rows>
Description
Publish a list of rows {routing_key, body}, with optional message_id and correlation_id. Confirms are awaited at least every 1000 messages. Returns {sent, failed, not_attempted, returned, errors}: sent counts the rows confirmed (or written, with confirm false), failed every row not sent, not_attempted those after a connection error or a closed channel, where the list stops. Without confirms a closed channel leaves sent at 0, as nothing tells what was taken. An invalid row does not stop the list. If the first connection fails the function fails
Publish a list of rows {routing_key, body}, with optional message_id and correlation_id. Confirms are awaited at least every 1000 messages. Returns {sent, failed, not_attempted, returned, errors}: sent counts the rows confirmed (or written, with confirm false), failed every row not sent, not_attempted those after a connection error or a closed channel, where the list stops. Without confirms a closed channel leaves sent at 0, as nothing tells what was taken. An invalid row does not stop the list. If the first connection fails the function fails
Parameters
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
exchange: The name of the exchange, at most 255 bytes in UTF-8 (empty for a publish: the default exchange, where the routing key is the name of a queue) - String - required
json_rows: The messages as a JSON array of objects (100000 at most). A value that is not a text is sent as JSON; numbers are kept exactly - String - required
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
exchange: The name of the exchange, at most 255 bytes in UTF-8 (empty for a publish: the default exchange, where the routing key is the name of a queue) - String - required
json_rows: The messages as a JSON array of objects (100000 at most). A value that is not a text is sent as JSON; numbers are kept exactly - String - required
admin
amqp publish_batch "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "orders" "[{\"routing_key\": \"eu.new\", \"body\": \"order 6\", \"message_id\": \"m-6\"}, {\"body\": \"no key\"}, {\"routing_key\": \"eu.new\", \"body\": {\"id\": 7}}]"
mentdb
{"sent": 2, "failed": 1, "not_attempted": 0, "returned": 0, "errors": [{"row": 1, "error": "the field 'routing_key' must be a text"}]}
amqp publish_batch <config> <exchange> <json_rows> <json_params>
Description
Publish a list with parameters: routing_key_field (routing_key), body_field (body), content_type, headers, persistent (true), mandatory (false), confirm (true), encoding (utf-8)
Publish a list with parameters: routing_key_field (routing_key), body_field (body), content_type, headers, persistent (true), mandatory (false), confirm (true), encoding (utf-8)
Parameters
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
exchange: The name of the exchange, at most 255 bytes in UTF-8 (empty for a publish: the default exchange, where the routing key is the name of a queue) - String - required
json_rows: The messages as a JSON array of objects (100000 at most). A value that is not a text is sent as JSON; numbers are kept exactly - String - required
json_params: The parameters - String - required
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
exchange: The name of the exchange, at most 255 bytes in UTF-8 (empty for a publish: the default exchange, where the routing key is the name of a queue) - String - required
json_rows: The messages as a JSON array of objects (100000 at most). A value that is not a text is sent as JSON; numbers are kept exactly - String - required
json_params: The parameters - String - required
admin
amqp publish_batch "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "orders" "[{\"k\": \"eu.new\", \"v\": \"order 8\"}, {\"k\": \"asia.new\", \"v\": \"order 9\"}]" "{\"routing_key_field\": \"k\", \"body_field\": \"v\", \"mandatory\": true}"
mentdb
{"sent": 1, "failed": 1, "not_attempted": 0, "returned": 0, "errors": [{"row": 1, "error": "the broker has refused the message (nack)"}]}
amqp queue_info <config> <queue>
Description
Information about a queue, by a passive declare: {exists, messages, consumers}. An unknown queue gives exists false and null counts, not an error
Information about a queue, by a passive declare: {exists, messages, consumers}. An unknown queue gives exists false and null counts, not an error
Parameters
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
queue: The name of the queue, at most 255 bytes in UTF-8 - String - required
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
queue: The name of the queue, at most 255 bytes in UTF-8 - String - required
admin
amqp queue_info "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "orders.eu"
mentdb
{"exists": true, "messages": 6, "consumers": 0}
no such queue (fixed result: a real local Apache Qpid Broker-J 9.2.0, not RabbitMQ)
admin
amqp queue_info "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "nothing"
mentdb
{"exists": false, "messages": null, "consumers": null}
amqp consume <config> <queue>
Description
Read and acknowledge at most 100 messages and 16 MB. If the queue is empty it is checked again for up to 5 seconds; once there are rows, an empty queue ends the reading at once. Returns JSON rows {body, encoding, routing_key, exchange, headers, delivery_tag, redelivered}, with content_type, message_id, correlation_id when present; encoding is utf-8, or base64 when the body is not valid UTF-8. An unknown queue is an error
Read and acknowledge at most 100 messages and 16 MB. If the queue is empty it is checked again for up to 5 seconds; once there are rows, an empty queue ends the reading at once. Returns JSON rows {body, encoding, routing_key, exchange, headers, delivery_tag, redelivered}, with content_type, message_id, correlation_id when present; encoding is utf-8, or base64 when the body is not valid UTF-8. An unknown queue is an error
Parameters
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
queue: The name of the queue, at most 255 bytes in UTF-8 - String - required
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
queue: The name of the queue, at most 255 bytes in UTF-8 - String - required
admin
amqp consume "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "orders.us"
mentdb
[{"body": "order 2", "encoding": "utf-8", "routing_key": "orders.us", "exchange": "", "headers": null, "delivery_tag": 1, "redelivered": false}]
amqp consume <config> <queue> <json_params>
Description
Read with parameters: max_messages (100, up to 100000), timeout_ms (5000: the limit of the reading; 0: no wait on an empty queue), ack (true; false: the messages are read and put back at the end, with redelivered true afterwards), max_bytes (16 MB, up to 256 MB, on the sum of the bodies and headers)
Read with parameters: max_messages (100, up to 100000), timeout_ms (5000: the limit of the reading; 0: no wait on an empty queue), ack (true; false: the messages are read and put back at the end, with redelivered true afterwards), max_bytes (16 MB, up to 256 MB, on the sum of the bodies and headers)
Parameters
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
queue: The name of the queue, at most 255 bytes in UTF-8 - String - required
json_params: The parameters - String - required
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
queue: The name of the queue, at most 255 bytes in UTF-8 - String - required
json_params: The parameters - String - required
admin
amqp consume "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "orders.eu" "{\"ack\": false, \"max_messages\": 2}"
mentdb
[{"body": "order 1", "encoding": "utf-8", "routing_key": "eu.new", "exchange": "orders", "headers": null, "delivery_tag": 1, "redelivered": false}, {"body": "{\"id\": 3}", "encoding": "utf-8", "routing_key": "eu.new", "exchange": "orders", "headers": {"source": "erp", "try": 1}, "delivery_tag": 2, "redelivered": false, "content_type": "application/json", "message_id": "m-3", "correlation_id": "c-3"}]
take the first one (fixed result: a real local Apache Qpid Broker-J 9.2.0, not RabbitMQ)
admin
amqp consume "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "orders.eu" "{\"max_messages\": 1, \"timeout_ms\": 0}"
mentdb
[{"body": "order 1", "encoding": "utf-8", "routing_key": "eu.new", "exchange": "orders", "headers": null, "delivery_tag": 1, "redelivered": true}]
amqp purge <config> <queue>
Description
Remove the ready messages of a queue. Returns {queue, purged}
Remove the ready messages of a queue. Returns {queue, purged}
Parameters
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
queue: The name of the queue, at most 255 bytes in UTF-8 - String - required
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
queue: The name of the queue, at most 255 bytes in UTF-8 - String - required
admin
amqp purge "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "orders.eu"
mentdb
{"queue": "orders.eu", "purged": 5}
amqp delete_queue <config> <queue>
Description
Delete a queue and its messages. Returns {queue, deleted}, with the number of messages deleted. An unknown queue is an error 404 on Qpid Broker-J; RabbitMQ is documented to accept it
Delete a queue and its messages. Returns {queue, deleted}, with the number of messages deleted. An unknown queue is an error 404 on Qpid Broker-J; RabbitMQ is documented to accept it
Parameters
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
queue: The name of the queue, at most 255 bytes in UTF-8 - String - required
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
queue: The name of the queue, at most 255 bytes in UTF-8 - String - required
admin
amqp delete_queue "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}" "orders.tmp"
mentdb
{"queue": "orders.tmp", "deleted": 0}
amqp test <config>
Description
Try a connection and a channel. Returns {ok, latency_ms, error}: a broker that is stopped or refuses the credentials gives ok false and the reason; only an invalid configuration is an error of the function
Try a connection and a channel. Returns {ok, latency_ms, error}: a broker that is stopped or refuses the credentials gives ok false and the reason; only an invalid configuration is an error of the function
Parameters
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
config: The AMQP configuration as JSON: uri (amqp://user:password@host:port/vhost or amqps://..., percent-encoded, the path /%2f is the vhost /), or host, port (5672 or 5671), vhost (/), tls (false), then username and password (or password_env: the name of an environment variable; without them the client sends guest/guest, the default of RabbitMQ), timeout_ms (10000, from 100 to 600000, for each network step), allow_plain (false: a password in clear to a host other than localhost or 127.x.x.x is refused; no DNS request decides this). With TLS the certificate and the host name are checked, also for amqps://: trust_store (a PEM or DER certificate file, PKCS12 or JKS, under the file access rules), trust_store_password (or trust_store_password_env), trust_store_type, or trust_all (false; true accepts any certificate, for a test only) - String - required
admin
amqp test "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_PASSWORD\"}"
mentdb
{"ok": true, "latency_ms": 3, "error": null}
bad credentials (fixed result: a real local Apache Qpid Broker-J 9.2.0, not RabbitMQ)
admin
amqp test "{\"host\": \"127.0.0.1\", \"port\": 25672, \"username\": \"guest\", \"password_env\": \"AMQP_WRONG_PASSWORD\"}"
mentdb
{"ok": false, "latency_ms": 3, "error": "AMQP: authentication failed: check the username, the password and the vhost"}
