- Hands-On Microservices with C#
- Matt R. Cole
- 145字
- 2021-07-23 17:25:20
Creating common messages
Let's start with a very simple message, the deployment messages:
public class DeploymentStartMessage
{
public DateTime Date { get; set; }
}
public class DeploymentStopMessage
{
public DateTime Date { get; set; }
}
As you can see, they are not overly complicated. What will happen is that we will have a DeploymentMonitor microservice. As soon as our deployment kicks off, we will send a DeploymentStartMessage to the message queue. Our microservice manager will receive the message, and immediately disable tracking each microservice's health until the DeploymentStopMessage is received.
Always include all your messages in the same namespace. This makes it much easier for EasyNetQ and its type name resolver to know where the messages are coming from. It also gives you a centralized location for all your messages, and lastly, prevents a lot of weird looking exchange and queue names!
推薦閱讀
- 空間機(jī)器人遙操作系統(tǒng)及控制
- Java實(shí)用組件集
- 極簡AI入門:一本書讀懂人工智能思維與應(yīng)用
- 自動(dòng)化控制工程設(shè)計(jì)
- Learning Azure Cosmos DB
- Windows Server 2003系統(tǒng)安全管理
- Dreamweaver CS6精彩網(wǎng)頁制作與網(wǎng)站建設(shè)
- 手機(jī)游戲程序開發(fā)
- Photoshop CS4數(shù)碼照片處理入門、進(jìn)階與提高
- 空間機(jī)器人智能感知技術(shù)
- 常用傳感器技術(shù)及應(yīng)用(第2版)
- 人工智能云平臺(tái):原理、設(shè)計(jì)與應(yīng)用
- JSP通用范例開發(fā)金典
- Containerization with Ansible 2
- Web滲透技術(shù)及實(shí)戰(zhàn)案例解析