Skip to main content

Operations

A receive operation reports the consumer group its descriptor names, and the client id its config sets.

The operation binding carries groupId and clientId, each as a one-value schema. groupId is the group the descriptor names, such as KafkaTopic::group. The document is built before the broker connects, from the descriptor alone, so the broker's default_group does not appear. clientId appears when the descriptor's config sets client.id. An operation with neither carries no binding.

Example​

The operation receive_orders reports the group orders-svc and the client id orders-reader.

#[subscriber(
KafkaTopic::new("orders")
.group("orders-svc")
.config("client.id", "orders-reader"),
reply("confirmations")
)]
async fn confirm(order: &Order) -> Confirmation {
Confirmation { id: order.id }
}