-
-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0678814
commit 7ef00c4
Showing
7 changed files
with
205 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,84 @@ | ||
asyncapi: 2.2.0 | ||
|
||
asyncapi: 3.0.0 | ||
info: | ||
title: Website Backend | ||
version: 1.0.0 | ||
|
||
servers: | ||
websiteWebSocketServer: | ||
$ref: '../common/servers.yaml#/websiteWebSocketServer' | ||
$ref: ../common/servers.yaml#/websiteWebSocketServer | ||
mosquitto: | ||
url: mqtt://test.mosquitto.org | ||
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: websocketServer | ||
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" | ||
|
||
channels: | ||
comment/liked: | ||
address: comment/liked | ||
messages: | ||
subscribe.message: | ||
$ref: ../common/messages.yaml#/commentLiked | ||
description: Notify all the services that a comment has been liked. | ||
servers: ['mosquitto'] | ||
subscribe: | ||
message: | ||
$ref: '../common/messages.yaml#/commentLiked' | ||
servers: | ||
- $ref: '#/servers/mosquitto' | ||
like/comment: | ||
address: like/comment | ||
messages: | ||
publish.message: | ||
$ref: ../common/messages.yaml#/likeComment | ||
description: When a comment like is received from the frontend. | ||
servers: ['websiteWebSocketServer'] | ||
publish: | ||
message: | ||
$ref: '../common/messages.yaml#/likeComment' | ||
comment/{commentId}/changed: | ||
description: When an event from the broker arrives telling us to update the comment likes count on the frontend. | ||
parameters: | ||
servers: | ||
- $ref: '#/servers/websiteWebSocketServer' | ||
'comment/{commentId}/changed': | ||
address: 'comment/{commentId}/changed' | ||
messages: | ||
publish.message: | ||
$ref: ../common/messages.yaml#/commentChanged | ||
description: >- | ||
When an event from the broker arrives telling us to update the comment | ||
likes count on the frontend. | ||
servers: | ||
- $ref: '#/servers/mosquitto' | ||
parameters: | ||
commentId: | ||
schema: | ||
$ref: '../common/schemas.yaml#/commentId' | ||
servers: ['mosquitto'] | ||
publish: | ||
message: | ||
$ref: '../common/messages.yaml#/commentChanged' | ||
schema: | ||
$ref: ../common/schemas.yaml#/commentId | ||
update/comment/likes: | ||
address: update/comment/likes | ||
messages: | ||
subscribe.message: | ||
$ref: ../common/messages.yaml#/updateCommentLikes | ||
description: Update comment likes count in the frontend. | ||
servers: ['websiteWebSocketServer'] | ||
subscribe: | ||
message: | ||
$ref: '../common/messages.yaml#/updateCommentLikes' | ||
servers: | ||
- $ref: '#/servers/websiteWebSocketServer' | ||
operations: | ||
comment/liked.subscribe: | ||
action: send | ||
channel: | ||
$ref: '#/channels/comment~1liked' | ||
messages: | ||
- $ref: ../common/messages.yaml#/commentLiked | ||
like/comment.publish: | ||
action: receive | ||
channel: | ||
$ref: '#/channels/like~1comment' | ||
messages: | ||
- $ref: ../common/messages.yaml#/likeComment | ||
'comment/{commentId}/changed.publish': | ||
action: receive | ||
channel: | ||
$ref: '#/channels/comment~1{commentId}~1changed' | ||
messages: | ||
- $ref: ../common/messages.yaml#/commentChanged | ||
update/comment/likes.subscribe: | ||
action: send | ||
channel: | ||
$ref: '#/channels/update~1comment~1likes' | ||
messages: | ||
- $ref: ../common/messages.yaml#/updateCommentLikes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,53 @@ | ||
asyncapi: 2.2.0 | ||
|
||
asyncapi: 3.0.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: | ||
url: mqtt://test.mosquitto.org | ||
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 | ||
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" | ||
|
||
channels: | ||
comment/liked: | ||
description: Updates the likes count in the database and sends the new count to the broker. | ||
publish: | ||
message: | ||
$ref: '../common/messages.yaml#/commentLiked' | ||
comment/{commentId}/changed: | ||
description: Sends the new count to the broker after it has been updated in the database. | ||
parameters: | ||
address: comment/liked | ||
messages: | ||
publish.message: | ||
$ref: ../common/messages.yaml#/commentLiked | ||
description: >- | ||
Updates the likes count in the database and sends the new count to the | ||
broker. | ||
'comment/{commentId}/changed': | ||
address: 'comment/{commentId}/changed' | ||
messages: | ||
subscribe.message: | ||
$ref: ../common/messages.yaml#/commentChanged | ||
description: >- | ||
Sends the new count to the broker after it has been updated in the | ||
database. | ||
parameters: | ||
commentId: | ||
schema: | ||
$ref: '../common/schemas.yaml#/commentId' | ||
subscribe: | ||
message: | ||
$ref: '../common/messages.yaml#/commentChanged' | ||
|
||
schema: | ||
$ref: ../common/schemas.yaml#/commentId | ||
operations: | ||
comment/liked.publish: | ||
action: receive | ||
channel: | ||
$ref: '#/channels/comment~1liked' | ||
messages: | ||
- $ref: ../common/messages.yaml#/commentLiked | ||
'comment/{commentId}/changed.subscribe': | ||
action: send | ||
channel: | ||
$ref: '#/channels/comment~1{commentId}~1changed' | ||
messages: | ||
- $ref: ../common/messages.yaml#/commentChanged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
websiteWebSocketServer: | ||
url: ws://mycompany.com/ws | ||
host: mycompany.com | ||
pathname: /ws | ||
protocol: ws |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,33 @@ | ||
asyncapi: 2.2.0 | ||
|
||
asyncapi: 3.0.0 | ||
info: | ||
title: Website WebSocket Client | ||
version: 1.0.0 | ||
|
||
servers: | ||
websiteWebSocketServer: | ||
$ref: '../common/servers.yaml#/websiteWebSocketServer' | ||
|
||
$ref: ../common/servers.yaml#/websiteWebSocketServer | ||
channels: | ||
like/comment: | ||
address: like/comment | ||
messages: | ||
subscribe.message: | ||
$ref: ../common/messages.yaml#/likeComment | ||
description: Notify the backend that a comment has been liked. | ||
subscribe: | ||
message: | ||
$ref: '../common/messages.yaml#/likeComment' | ||
update/comment/likes: | ||
address: update/comment/likes | ||
messages: | ||
publish.message: | ||
$ref: ../common/messages.yaml#/updateCommentLikes | ||
description: Update the UI when the comment likes count is updated. | ||
publish: | ||
message: | ||
$ref: '../common/messages.yaml#/updateCommentLikes' | ||
operations: | ||
like/comment.subscribe: | ||
action: send | ||
channel: | ||
$ref: '#/channels/like~1comment' | ||
messages: | ||
- $ref: ../common/messages.yaml#/likeComment | ||
update/comment/likes.publish: | ||
action: receive | ||
channel: | ||
$ref: '#/channels/update~1comment~1likes' | ||
messages: | ||
- $ref: ../common/messages.yaml#/updateCommentLikes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,34 @@ | ||
asyncapi: 2.2.0 | ||
|
||
asyncapi: 3.0.0 | ||
info: | ||
title: Notifications Service | ||
version: 1.0.0 | ||
|
||
servers: | ||
mosquitto: | ||
url: mqtt://test.mosquitto.org | ||
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: notification-service | ||
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" | ||
|
||
channels: | ||
comment/liked: | ||
description: When a "comment has been liked" message is received, it sends an SMS or push notification to the author. | ||
publish: | ||
message: | ||
$ref: '../common/messages.yaml#/commentLiked' | ||
address: comment/liked | ||
messages: | ||
publish.message: | ||
$ref: ../common/messages.yaml#/commentLiked | ||
description: >- | ||
When a "comment has been liked" message is received, it sends an SMS or | ||
push notification to the author. | ||
operations: | ||
comment/liked.publish: | ||
action: receive | ||
channel: | ||
$ref: '#/channels/comment~1liked' | ||
messages: | ||
- $ref: ../common/messages.yaml#/commentLiked |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,35 @@ | ||
asyncapi: 2.2.0 | ||
|
||
asyncapi: 3.0.0 | ||
info: | ||
title: Public API | ||
description: Public API for others to interact with the system | ||
title: Public API | ||
version: 1.0.0 | ||
|
||
description: Public API for others to interact with the system | ||
servers: | ||
mosquitto: | ||
url: mqtt://test.mosquitto.org | ||
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: public-api | ||
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" | ||
|
||
channels: | ||
comment/liked: | ||
description: Others are publishing to you, whenever a comment is liked, for you to do react to such an event. | ||
publish: | ||
message: | ||
$ref: '../common/messages.yaml#/commentLiked' | ||
address: comment/liked | ||
messages: | ||
publish.message: | ||
$ref: ../common/messages.yaml#/commentLiked | ||
description: >- | ||
Others are publishing to you, whenever a comment is liked, for you to do | ||
react to such an event. | ||
operations: | ||
comment/liked.publish: | ||
action: receive | ||
channel: | ||
$ref: '#/channels/comment~1liked' | ||
messages: | ||
- $ref: ../common/messages.yaml#/commentLiked |
Oops, something went wrong.