Skip to content

Solace

Solace binding。輸出的成員是 solace,每個物件都帶 bindingVersion: 0.4.0

@solaceServer

typespec
extern dec solaceServer(target: Namespace, config: valueof AsyncAPISolaceServerBinding);
欄位型別必填
msgVpnstring
clientNamestring

套用在服務 namespace 上。clientName 最長 160 個字元。

輸出的欄位是 msgVpn。Solace binding 的 0.2.0 版把它拼成 msvVpn,本 library 輸出 0.4.0 版。

typespec
@service(#{ title: "Orders" })
@server("prod", #{ host: "solace.example.com:55555", protocol: "solace" })
@solaceServer(#{ msgVpn: "orders-vpn", clientName: "orders-service" })
namespace Orders;
yaml
servers:
  prod:
    host: solace.example.com:55555
    protocol: solace
    bindings:
      solace:
        msgVpn: orders-vpn
        clientName: orders-service
        bindingVersion: 0.4.0

@solaceOperation

typespec
extern dec solaceOperation(target: Operation, config: valueof AsyncAPISolaceOperationBinding);
欄位型別必填
destinationsunknown[]
timeToLiveint32
priorityint32
dmqEligibleboolean

套用在帶有 @send@receive 的 operation 上。

destinations 的每一筆可以帶 deliveryMode,值為 directpersistent。其他值會透過 invalid-binding-field 回報。該欄位會被丟棄,該筆的其餘欄位原樣輸出。沒有剩下任何欄位的一筆會被丟棄。沒有剩下任何一筆的 destinations 也會被丟棄。

priority 是零或以上。

typespec
@send
@solaceOperation(#{
  destinations: #[#{ destinationType: "queue", deliveryMode: "persistent" }],
  timeToLive: 60000,
  priority: 5,
  dmqEligible: true
})
op publish(event: OrderCreated): void;
yaml
operations:
  publish:
    action: send
    channel:
      $ref: "#/channels/orders-queue"
    bindings:
      solace:
        destinations:
          - deliveryMode: persistent
            destinationType: queue
        timeToLive: 60000
        priority: 5
        dmqEligible: true
        bindingVersion: 0.4.0