结构
约束
默认大小为 5MB
调整大小需要调整 broker 和 bookkeeper 的配置:
- broker.conf : maxMessageSize
- bookkeeper.conf: nettyMaxFrameSizeBytes
ack 机制
ack 的发送在 consumer 消费成功后给broker。
- 确认每一个数据:consumer.acknowledge(msg);
- 确认最后一条成功数据:consumer.acknowledgeCumulative(msg);
- negative ack 机制:用于消费失败重试,可能导致乱序,如果使用,建议超时后才触发
- Exclusive and Failover subscription types, consumers only negatively acknowledge the last message
- Shared and Key_Shared subscription types, consumers can negatively acknowledge messages individually.
- redelivery 超时时间:set a time range during wh