Skip to content
← Back to Index

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:

FieldRequiredDescription
connectionYesThe connection id to send through.
addressYesThe destination address, interpreted by the connection's adapter.
bodyNoThe message body.
contentTypeNoContent type for the body (default application/json).
applicationPropertiesNoNamed application properties carried on the message.
messageIdNoStandard message property.
correlationIdNoStandard message property.
subjectNoStandard message property.
replyToNoStandard 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 ​

PromotionRuleReactorEgress
✓

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

© 2026 Hantera AB. Org. no.: 559242-9582