Topic/Partition Initial Offset
有几种方法可以设置分区对的初始偏移量。
There are several ways to set the initial offset for a partition.
在手动分配分区时,可以在已配置“@ [8]”参数(请参阅“@ [9]”)中设置初始偏移量(如果需要)。还可以随时跳转到特定偏移量。
When manually assigning partitions, you can set the initial offset (if desired) in the configured TopicPartitionOffset
arguments (see Message Listener Containers).
You can also seek to a specific offset at any time.
如果你使用分组管理,并且代理分配分区:
When you use group management where the broker assigns partitions:
-
对于新的
group.id
, 初始偏移量由auto.offset.reset`使用者属性 (`earliest`或 `latest
) 决定。 -
For a new
group.id
, the initial offset is determined by theauto.offset.reset
consumer property (earliest
orlatest
). -
对于现有的组 ID, 初始偏移量是该组 ID 的当前偏移量。不过, 可以在初始化过程中(或在任何时候之后)寻址到特定偏移量。
-
For an existing group ID, the initial offset is the current offset for that group ID. You can, however, seek to a specific offset during initialization (or at any time thereafter).