- 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ì)算機(jī)應(yīng)用
- 嵌入式系統(tǒng)應(yīng)用
- Ansible Quick Start Guide
- 計(jì)算機(jī)控制技術(shù)
- Matplotlib 3.0 Cookbook
- Security Automation with Ansible 2
- 完全掌握AutoCAD 2008中文版:綜合篇
- Blender Compositing and Post Processing
- 網(wǎng)絡(luò)安全管理實(shí)踐
- Hands-On Reactive Programming with Reactor
- 基于敏捷開發(fā)的數(shù)據(jù)結(jié)構(gòu)研究
- MongoDB 4 Quick Start Guide
- Instant Slic3r
- 機(jī)器人剛?cè)狁詈蟿?dòng)力學(xué)
- 中文版Photoshop情境實(shí)訓(xùn)教程