Эта страница ещё не переведена
Ниже показан английский оригинал.
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.
- Macros
- Manual
#[subscriber(
KafkaTopic::new("orders")
.group("orders-svc")
.config("client.id", "orders-reader"),
reply("confirmations")
)]
async fn confirm(order: &Order) -> Confirmation {
Confirmation { id: order.id }
}
/// The topic `orders`, read in the group `orders-svc` by the client `orders-reader`.
fn orders() -> KafkaTopic {
KafkaTopic::new("orders")
.group("orders-svc")
.config("client.id", "orders-reader")
}