Skip to content

Instantly share code, notes, and snippets.

@peter-rr
Created November 10, 2022 18:00
Show Gist options
  • Save peter-rr/c068c5d67b7223c4c18de489746dcd50 to your computer and use it in GitHub Desktop.
Save peter-rr/c068c5d67b7223c4c18de489746dcd50 to your computer and use it in GitHub Desktop.
GLEE_SERVER_NAMES=development
asyncapi: 2.5.0
info:
title: Backend service API
version: 1.0.0
description: This is the website backend service that interact with users.
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
defaultContentType: application/json
servers:
development:
url: mqtt://test.mosquitto.org:1883
protocol: mqtt
description: Local development broker
bindings:
mqtt:
clientId: notifications-service
channels:
orderservice/new/order:
description: New order being placed
subscribe:
operationId: produceNewOrder
message:
$ref: '#/components/messages/NewOrderMessage'
management/new/product:
description: New order being placed
publish:
operationId: consumeNewProduct
message:
$ref: '#/components/messages/NewProductMessage'
components:
messages:
NewProductMessage:
name: newProductMessage
title: New product message
summary: When a new product has been created.
payload:
$ref: '#/components/schemas/newProductMessagePayload'
NewOrderMessage:
name: newOrderMessage
title: New order message
summary: When a new order has been placed this message is sent.
payload:
$ref: '#/components/schemas/newOrderMessagePayload'
schemas:
Product:
type: object
properties:
product_id:
type: integer
product_title:
type: string
product_type:
type: string
enum:
- record
- mp3
- merchandise
newProductMessagePayload:
allOf:
- $ref: '#/components/schemas/Product'
- type: object
properties:
product_creation_timestamp:
type: string
format: date-time
newOrderMessagePayload:
allOf:
- $ref: '#/components/schemas/Product'
- type: object
properties:
order_timestamp:
type: string
format: date-time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment