rabbitmq/service
Use this extension when your workload sends or receives messages with RabbitMQ.
In RabbitMQ, a workload sends a message to an exchange, together with a routing key. The exchange uses the routing key to put the message into one or more queues. Other workloads then read the messages from those queues. Exchanges and queues live inside a virtual host, which is like a separate space on the RabbitMQ server.
In a Condition, you give the virtual host, and you list every exchange that your workload sends to and every queue that it reads from. The platform then creates them or gives your workload access to them.
Write the exact names. Patterns are not allowed.
Documentation
This extension describes a workload that publishes to RabbitMQ exchanges or
consumes from RabbitMQ queues through AMQP 0-9-1. Each Condition uses
kind: rabbitmq.service and interface.type: amqp_0_9_1.
interface.virtualHost identifies the virtual host containing every resource
in the Condition. It is required; / explicitly names the default virtual host.
The Condition's name identifies the logical service requirement. Workloads
accessing several virtual hosts declare a separate Condition for each one.
Capabilities
| Resource | Action | Required fields | Requirement |
|---|---|---|---|
exchange |
publish |
exchange, routingKey |
Publish messages to the exchange using this routing key. |
queue |
consume |
queue |
Receive messages from the named queue. |
The operations array is nonempty and contains no duplicate entries. A workload that publishes and consumes declares both operations. Exchange and queue access remain independent, even when the resource names are identical.
The default exchange is represented by exchange: "". RabbitMQ automatically
routes from it to an existing queue whose name equals the routing key. Its
permission-management alias, amq.default, is not the publishing target name.
An empty routing key is also a valid explicit publishing value. Missing
exchange and routingKey fields are rejected; an empty queue name is rejected
because consumption requires an identified queue.
See the publisher, consumer, and default-exchange publisher profiles.
Fulfillment
Publishing corresponds to RabbitMQ's write permission on an exchange, while consumption corresponds to read permission on a queue. The routing key lets an adapter account for topic-exchange authorization where it is enabled. Required exchanges, queues and routing must already be available when these operations run. These capabilities describe access, rather than requesting declarations or queue bindings.
Resource names and routing keys are literal strings. Adapters translating names into permission expressions must escape regular-expression characters and scope permissions to the declared virtual host. RabbitMQ permissions can authorize several protocol operations; an adapter must apply the broker's actual permission model when fulfilling each requirement.
The schema rejects NUL characters and bounds these strings to 255 characters. AMQP short strings are limited to 255 UTF-8 bytes, so adapters or clients must also check the encoded length before sending multibyte names and routing keys.
Generated bindings represent the operation alternatives through the existing emitters' shared types. Validate profiles against the extension schema to reject invalid action/resource combinations and missing identities.
The contract follows RabbitMQ's authorization table, virtual-host model, and exchange semantics. Short-string encoding is defined in section 4.2.5.3 of the AMQP 0-9-1 specification.
Packages
Install the package for your language to declare this extension's Conditions from your code.
Go
This package version is generated but not published to its registry yet.
go get runtimeconditions.io/x/rabbitmq/service@v0.2.0
Conditions
Every Condition part this package defines, with the fields you can set. Select a line to open it.
rabbitmq.service · amqp_0_9_1: Your workload connects to RabbitMQ with a normal AMQP 0-9-1 client library, the protocol that most RabbitMQ clients use.
service.Amqp091 is the interface of a rabbitmq.service Condition.
| Field | Type | Required | Description |
|---|---|---|---|
Operations |
Operations |
yes | The exchanges that your workload sends to and the queues that it reads from. Each line names one of them. The exchanges and queues in this virtual host that your workload uses. List at least one, and do not repeat a line. |
Operations[].Action |
Action |
yes | What the workload does with it. Values: consume: Read messages from a queue.publish: Send messages to an exchange, with the routing key given in the same line. |
Operations[].Exchange |
*string |
no | The exact name of the exchange. Write an empty string for the default exchange. |
Operations[].Queue |
*string |
no | The exact name of the queue that the workload reads from. |
Operations[].Resource |
Resource |
yes | What the line is about, an exchange or a queue. Values: exchange: An exchange, which receives the messages that your workload sends.queue: A queue, which holds the messages that your workload reads. |
Operations[].RoutingKey |
*string |
no | The exact routing key that the workload sends with each message. It can be empty. |
VirtualHost |
string |
yes | The exact name of the virtual host. Every exchange and queue in this Condition is inside it. The exact name of the virtual host. Write / for the default virtual host. |
RabbitmqService
service.RabbitmqService declares a rabbitmq.service Condition.
Example: a workload that sends an event to the order-events exchange, with the routing key orders.created, each time someone places an order.
service.RabbitmqService(
service.Amqp091{
Operations: service.Operations{
service.OperationsItem{
Action: service.ActionPublish,
Exchange: &[]string{"order-events"}[0],
Resource: service.ResourceExchange,
RoutingKey: &[]string{"orders.created"}[0],
},
},
VirtualHost: "/orders",
},
)
The full API, with every type, field and constant documented, is in the Go package documentation.
Python
This package version is generated but not published to its registry yet.
pip install runtimeconditions-rabbitmq-service
Conditions
Every Condition part this package defines, with the fields you can set. Select a line to open it.
rabbitmq.service · amqp_0_9_1: Your workload connects to RabbitMQ with a normal AMQP 0-9-1 client library, the protocol that most RabbitMQ clients use.
Amqp091 is the interface of a rabbitmq.service Condition.
| Field | Type | Required | Description |
|---|---|---|---|
operations |
Operations |
yes | The exchanges that your workload sends to and the queues that it reads from. Each line names one of them. The exchanges and queues in this virtual host that your workload uses. List at least one, and do not repeat a line. |
operations[].action |
Action |
yes | What the workload does with it. Values: consume: Read messages from a queue.publish: Send messages to an exchange, with the routing key given in the same line. |
operations[].resource |
Resource |
yes | What the line is about, an exchange or a queue. Values: exchange: An exchange, which receives the messages that your workload sends.queue: A queue, which holds the messages that your workload reads. |
operations[].exchange |
str | None |
no | The exact name of the exchange. Write an empty string for the default exchange. |
operations[].queue |
str | None |
no | The exact name of the queue that the workload reads from. |
operations[].routing_key |
str | None |
no | The exact routing key that the workload sends with each message. It can be empty. |
virtual_host |
str |
yes | The exact name of the virtual host. Every exchange and queue in this Condition is inside it. The exact name of the virtual host. Write / for the default virtual host. |
rabbitmq_service
rabbitmq_service declares a rabbitmq.service Condition.
Example: a workload that sends an event to the order-events exchange, with the routing key orders.created, each time someone places an order.
from runtimeconditions_rabbitmq_service import (
Action,
Amqp091,
OperationsItem,
Resource,
rabbitmq_service,
)
rabbitmq_service(
Amqp091(
operations=[
OperationsItem(
action=Action.PUBLISH,
resource=Resource.EXCHANGE,
exchange="order-events",
routing_key="orders.created",
),
],
virtual_host="/orders",
),
)
Every class, field and enum member is documented in the package's docstrings.
TypeScript
This package version is generated but not published to its registry yet.
npm install @runtimeconditions/rabbitmq-service
Conditions
Every Condition part this package defines, with the fields you can set. Select a line to open it.
rabbitmq.service · amqp_0_9_1: Your workload connects to RabbitMQ with a normal AMQP 0-9-1 client library, the protocol that most RabbitMQ clients use.
Amqp091 is the interface of a rabbitmq.service Condition.
| Field | Type | Required | Description |
|---|---|---|---|
operations |
Operations |
yes | The exchanges that your workload sends to and the queues that it reads from. Each line names one of them. The exchanges and queues in this virtual host that your workload uses. List at least one, and do not repeat a line. |
operations[].action |
Action |
yes | What the workload does with it. Values: consume: Read messages from a queue.publish: Send messages to an exchange, with the routing key given in the same line. |
operations[].resource |
Resource |
yes | What the line is about, an exchange or a queue. Values: exchange: An exchange, which receives the messages that your workload sends.queue: A queue, which holds the messages that your workload reads. |
operations[].exchange |
string |
no | The exact name of the exchange. Write an empty string for the default exchange. |
operations[].queue |
string |
no | The exact name of the queue that the workload reads from. |
operations[].routingKey |
string |
no | The exact routing key that the workload sends with each message. It can be empty. |
virtualHost |
string |
yes | The exact name of the virtual host. Every exchange and queue in this Condition is inside it. The exact name of the virtual host. Write / for the default virtual host. |
rabbitmqService
rabbitmqService declares a rabbitmq.service Condition.
Example: a workload that sends an event to the order-events exchange, with the routing key orders.created, each time someone places an order.
import { Action, Amqp091, OperationsItem, Resource, rabbitmqService } from "@runtimeconditions/rabbitmq-service";
rabbitmqService(
new Amqp091({
operations: [
new OperationsItem({
action: Action.Publish,
resource: Resource.Exchange,
exchange: "order-events",
routingKey: "orders.created",
}),
],
virtualHost: "/orders",
}),
);
Every class, field and enum member is documented in the package's type declarations.
Java
This package version is generated but not published to its registry yet.
<dependency>
<groupId>io.runtimeconditions.bindings</groupId>
<artifactId>runtimeconditions-rabbitmq-service</artifactId>
<version>0.2.0</version>
</dependency>
Conditions
Every Condition part this package defines, with the fields you can set. Select a line to open it.
rabbitmq.service · amqp_0_9_1: Your workload connects to RabbitMQ with a normal AMQP 0-9-1 client library, the protocol that most RabbitMQ clients use.
Amqp091 is the interface of a rabbitmq.service Condition.
| Field | Type | Required | Description |
|---|---|---|---|
operations |
Operations |
yes | The exchanges that your workload sends to and the queues that it reads from. Each line names one of them. The exchanges and queues in this virtual host that your workload uses. List at least one, and do not repeat a line. |
operations[].action |
Action |
yes | What the workload does with it. Values: consume: Read messages from a queue.publish: Send messages to an exchange, with the routing key given in the same line. |
operations[].resource |
Resource |
yes | What the line is about, an exchange or a queue. Values: exchange: An exchange, which receives the messages that your workload sends.queue: A queue, which holds the messages that your workload reads. |
operations[].exchange |
String |
no | The exact name of the exchange. Write an empty string for the default exchange. |
operations[].queue |
String |
no | The exact name of the queue that the workload reads from. |
operations[].routingKey |
String |
no | The exact routing key that the workload sends with each message. It can be empty. |
virtualHost |
String |
yes | The exact name of the virtual host. Every exchange and queue in this Condition is inside it. The exact name of the virtual host. Write / for the default virtual host. |
Bindings.rabbitmqService
Bindings.rabbitmqService declares a rabbitmq.service Condition.
Example: a workload that sends an event to the order-events exchange, with the routing key orders.created, each time someone places an order.
import io.runtimeconditions.bindings.rabbitmqservice.Action;
import io.runtimeconditions.bindings.rabbitmqservice.Amqp091;
import io.runtimeconditions.bindings.rabbitmqservice.Bindings;
import io.runtimeconditions.bindings.rabbitmqservice.Operations;
import io.runtimeconditions.bindings.rabbitmqservice.OperationsItem;
import io.runtimeconditions.bindings.rabbitmqservice.Resource;
import java.util.List;
Bindings.rabbitmqService(
new Amqp091(
new Operations(
List.of(
new OperationsItem(
Action.PUBLISH,
Resource.EXCHANGE,
"order-events",
null,
"orders.created"))),
"/orders"));
Every record, component and enum constant is documented in the Javadoc.
Kinds
rabbitmq.service
Your workload needs a RabbitMQ server with the exchanges and queues listed in the Condition.
Example: a workload that sends an event to the order-events exchange, with the routing key orders.created, each time someone places an order.
kind: rabbitmq.service
interface:
type: amqp_0_9_1
virtualHost: /orders
operations:
- resource: exchange
action: publish
exchange: order-events
routingKey: orders.created
Interface types
Interface types
amqp_0_9_1
Your workload connects to RabbitMQ with a normal AMQP 0-9-1 client library, the protocol that most RabbitMQ clients use.
Example: a workload that reads messages from the order-emails queue to send order emails. The virtual host / is the default one.
kind: rabbitmq.service
interface:
type: amqp_0_9_1
virtualHost: /
operations:
- resource: queue
action: consume
queue: order-emails
Fields
interface.virtualHostThe exact name of the virtual host. Every exchange and queue in this Condition is inside it.
interface.operationsThe exchanges that your workload sends to and the queues that it reads from. Each line names one of them.
| Value | Description |
|---|---|
exchange | An exchange, which receives the messages that your workload sends. |
queue | A queue, which holds the messages that your workload reads. |
| Value | Description |
|---|---|
publish | Send messages to an exchange, with the routing key given in the same line. |
consume | Read messages from a queue. |