packages feed

asyncapi3-1.0.0.0: reference/examples/social-media/comments-service/asyncapi.yaml

asyncapi: 3.1.0
info:
  title: Comments Service
  version: 1.0.0
  description: This service is in charge of processing all the events related to comments.
servers:
  mosquitto:
    host: test.mosquitto.org
    protocol: mqtt
    tags:
      - name: 'env:production'
        description: This environment is meant for production use case
      - name: 'kind:remote'
        description: This server is a remote server. Not exposed by the application
      - name: 'visibility:public'
        description: This resource is public and available to everyone
    bindings:
      mqtt:
        clientId: comment-service
channels:
  commentLiked:
    address: comment/liked
    messages:
      commentLiked:
        $ref: '../common/messages.yaml#/commentLiked'
    description: >-
      Updates the likes count in the database and sends the new count to the
      broker.
  commentCountChange:
    address: 'comment/{commentId}/changed'
    messages:
      commentChanged:
        $ref: '../common/messages.yaml#/commentChanged'
    description: >-
      Sends the new count to the broker after it has been updated in the
      database.
    parameters:
      commentId:
        $ref: '../common/parameters.yaml#/commentId'
operations:
  receiveCommentLiked:
    action: receive
    channel:
      $ref: '#/channels/commentLiked'
    messages:
      - $ref: '#/channels/commentLiked/messages/commentLiked'
  sendCommentChange:
    action: send
    channel:
      $ref: '#/channels/commentCountChange'
    messages:
      - $ref: '#/channels/commentCountChange/messages/commentChanged'