Skip to main content

Operations

A receive operation reports its queue group in the nats binding, the one field that binding has.

The binding is {"queue": "<group>", "bindingVersion": "0.1.0"}. The group is the one queue_group names on a CoreSubject or a CoreWildcard. A subscription outside a queue group carries no binding. A JetStream consumer carries none either: its durable name and its other settings are on the channel.

Example​

The operation receive_orders_created reports the queue group workers.

#[subscriber(CoreSubject::new("orders.created").queue_group("workers"))]
async fn confirm(order: &Order) -> HandlerOutcome {
tracing::info!(order.id, "order confirmed");
HandlerOutcome::ack()
}