InboundEventDeduplicator
public interface InboundEventDeduplicator
io/agentscope/extensions/channel/common/InboundEventDeduplicator.java:42–54定义入站事件 Deduplicator契约的接口。位于 io.agentscope.extensions.channel.common 包。核心成员包括 firstSeen。
Deduplicates inbound platform events across redeliveries.
Channel adapters consult this before processing an inbound event: delivery platforms (WeCom, DingTalk, GitHub, GitLab, ...) redeliver the same event when no timely acknowledgment is received, and each redelivery must execute at most once.
Keys are opaque and caller-composed — typically channelId + "|" + platformEventId.
Implementations backed by shared storage should namespace keys per deployment (for example with
an environment or application prefix): platform event ids are only unique within one channel
deployment, and a key shared by two deployments silently drops live traffic.
The default IdempotencyStore keeps state in the JVM heap, which only deduplicates
within a single process: a redelivery that lands on another instance, or after a restart, is not
recognized. Deployments running multiple channel instances should provide an implementation
backed by shared storage (for example a Redis SET ... NX EX keyed by channel and
platform event id). Injection today is programmatic: channels expose a fromProperties(channelId, routing, rawProperties, InboundEventDeduplicator) factory overload
for hand-wired setups, while the config-driven path (agentscope.json resolved through
the harness ChannelFactory) constructs channels with the default process-local store.
Implementations must be thread-safe: channels invoke #firstSeen(String) from
concurrent callback threads.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public boolean firstSeen(String key) | 设置该参数。 Records `key` and reports whether this is its first observation. |
方法详情Method Detail
firstSeen
public boolean firstSeen(String key)
设置该参数。
Records key and reports whether this is its first observation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
key | String | 键(类型 `String`)。opaque deduplication key composed by the caller; `null` is treated as always first-seen |
booleanio/agentscope/extensions/channel/common/InboundEventDeduplicator.java:53