send
Keyword
send(request: { connection: text, address: text, ... }): { sent: boolean, error? } The send keyword is the egress runtime's outbound message transport. It sends one message over a named connection — to a RabbitMQ queue, a Service Bus entity, or an Event Hubs stream — without the caller ever seeing the address or credentials.
It is only available inside egress components; the egress resource's ACL grants the connection-use right (connections/{id}:use).
The request record:
| Field | Required | Description |
|---|---|---|
connection | Yes | The connection id to send through. |
address | Yes | The destination address, interpreted by the connection's adapter. |
body | No | The message body. |
contentType | No | Content type for the body (default application/json). |
applicationProperties | No | Named application properties carried on the message. |
messageId | No | Standard message property. |
correlationId | No | Standard message property. |
subject | No | Standard message property. |
replyTo | No | Standard message property; a queue ingress can reply to it. |
send is one-way and total — it never throws. Transport failures arrive in the result's error field instead of escaping the egress program. The result:
filtrera
{ sent: boolean, error?: { code: text, message?: text } }Availability
| Promotion | Rule | Reactor | Egress |
|---|---|---|---|
| ✓ |
Examples
Publishing to a queue
filtrera
from send {
connection = 'apps/my-app/partner-rabbit'
address = '/queues/orders-created'
body = { eventType = 'order.created', payload = payload }
contentType = 'application/json'
applicationProperties = { 'eventType' -> 'order.created' }
}Handling a failed send
filtrera
let result = send {
connection = 'apps/my-app/partner-rabbit'
address = '/queues/orders-created'
body = payload
}
from result match
{ sent = true } |> { status = 'published' }
{ sent = false, error = { code, message } } |> {
error = { code = 'PUBLISH_FAILED', message = message }
}Sends carry the ambient trace, so a queue or stream ingress on the consuming side names the sending egress as its trace parent.
See Also
- Connections — endpoint, credentials, and recovery policy
- Egresses — the resource that owns the connection-use grant