Skip to content

Pulsar

Pulsar binding。輸出的成員是 pulsar,每個物件都帶 bindingVersion: 0.1.0

@pulsarServer

typespec
extern dec pulsarServer(target: Namespace, config: valueof AsyncAPIPulsarServerBinding);
欄位型別必填
tenantstring

套用在服務 namespace 上。topic 的位址是 <tenant>/<namespace>/<topic>,所以這個欄位和 channel 的 namespace 是同一個位址的兩個部分。

@pulsarChannel

typespec
extern dec pulsarChannel(
  target: Interface | Namespace,
  config: valueof AsyncAPIPulsarChannelBinding
);
欄位型別必填
namespacestring
persistencestring
compactionint32
geoReplicationstring[]
retentionAsyncAPIPulsarRetention
ttlint32
deduplicationboolean

套用在帶有 @channel@dynamicChannel 的 interface 或 namespace 上。

WARNING

namespace 是 TypeSpec 的保留字。欄位名稱要用反引號寫成 `namespace`: "orders"。輸出的欄位仍然是 namespace

namespacepersistence 是必填。缺任一個時,binding 會透過 missing-binding-field 回報並整個丟棄。persistencepersistentnon-persistent

geoReplication 用這個名稱,是因為 TypeSpec 的欄位名稱不能帶連字號。輸出的欄位是 geo-replication

retention.timeretention.size 是零或以上。零表示關閉該項保留。