Async Contracts

Mapa atual das filas BullMQ e das operacoes assíncronas internas do servico.

Canais

reminders.scanreminders.dispatchnotifications.scannotifications.dispatchpush.dispatch

Operacoes

enqueueReminderScanenqueueReminderDispatchenqueueNotificationScanenqueueNotificationDispatchenqueuePushDispatch

Modelo operacional

O contrato async documenta os jobs internos que trafegam por BullMQ/Redis. Nao e um broker publico, mas serve para registrar payloads, responsabilidade e observabilidade do fluxo.

  • reminders.scan: procura reminders elegiveis
  • reminders.dispatch: processa deliveries de reminders
  • notifications.scan: identifica deliveries pendentes
  • notifications.dispatch: prepara dispatch por canal/provider
  • push.dispatch: executa envio web push

Contrato bruto

Baixar AsyncAPI YAML

asyncapi: 3.0.0
info:
  title: Communications Service Async Contracts
  version: 0.1.0
  description: Internal asynchronous contracts represented over BullMQ/Redis queues.
channels:
  reminders.scan:
    address: reminders.scan
    messages:
      queueReminderScan:
        $ref: '#/components/messages/QueueReminderScan'
  reminders.dispatch:
    address: reminders.dispatch
    messages:
      queueReminderDispatch:
        $ref: '#/components/messages/QueueReminderDispatch'
  notifications.scan:
    address: notifications.scan
    messages:
      queueNotificationScan:
        $ref: '#/components/messages/QueueNotificationScan'
  notifications.dispatch:
    address: notifications.dispatch
    messages:
      queueNotificationDispatch:
        $ref: '#/components/messages/QueueNotificationDispatch'
  push.dispatch:
    address: push.dispatch
    messages:
      queuePushDispatch:
        $ref: '#/components/messages/QueuePushDispatch'
operations:
  enqueueReminderScan:
    action: send
    channel:
      $ref: '#/channels/reminders.scan'
    messages:
      - $ref: '#/channels/reminders.scan/messages/queueReminderScan'
  enqueueReminderDispatch:
    action: send
    channel:
      $ref: '#/channels/reminders.dispatch'
    messages:
      - $ref: '#/channels/reminders.dispatch/messages/queueReminderDispatch'
  enqueueNotificationScan:
    action: send
    channel:
      $ref: '#/channels/notifications.scan'
    messages:
      - $ref: '#/channels/notifications.scan/messages/queueNotificationScan'
  enqueueNotificationDispatch:
    action: send
    channel:
      $ref: '#/channels/notifications.dispatch'
    messages:
      - $ref: '#/channels/notifications.dispatch/messages/queueNotificationDispatch'
  enqueuePushDispatch:
    action: send
    channel:
      $ref: '#/channels/push.dispatch'
    messages:
      - $ref: '#/channels/push.dispatch/messages/queuePushDispatch'
components:
  messages:
    QueueReminderScan:
      payload:
        type: object
        additionalProperties: false
    QueueReminderDispatch:
      payload:
        type: object
        required: [deliveryId]
        properties:
          deliveryId:
            type: string
    QueueNotificationScan:
      payload:
        type: object
        additionalProperties: false
    QueueNotificationDispatch:
      payload:
        type: object
        required: [deliveryId]
        properties:
          deliveryId:
            type: string
    QueuePushDispatch:
      payload:
        type: object
        required: [deliveryId]
        properties:
          deliveryId:
            type: string