Interface NotificationChannel
- All Known Implementing Classes:
EmailNotificationChannel, InAppNotificationChannel, LineNotificationChannel, SmsNotificationChannel
public interface NotificationChannel
遞送通道 SPI
一個通道負責把 OutboundMessage 經某媒介(email / SMS / 站內信 / LINE …)送達。框架提供
EmailNotificationChannel 作為 ChannelType.EMAIL
的預設實作;後續階段以新增實作擴充其他通道,不動核心。
send 應為冪等友善:同一 OutboundMessage 可能因 at-least-once 重試被呼叫多次,
通道層或下游 provider 宜容忍重送(去重由 Outbox 的 dedupeKey 把關)。
- Since:
- 4.0.0
-
Method Summary
-
Method Details
-
type
-
send
遞送一則訊息
實作不應拋例外表達遞送失敗,改回傳
DeliveryResult.failed(String);拋出的 runtime 例外 由NotificationOutboxDispatcher視同失敗並記錄。- Parameters:
message- 要遞送的訊息- Returns:
- 遞送結果
-