- 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!
推薦閱讀
- 大數據項目管理:從規劃到實現
- 玩轉智能機器人程小奔
- Canvas LMS Course Design
- JavaScript實例自學手冊
- 空間機器人遙操作系統及控制
- INSTANT Varnish Cache How-to
- Ruby on Rails敏捷開發最佳實踐
- 中國戰略性新興產業研究與發展·工業機器人
- 工業機器人運動仿真編程實踐:基于Android和OpenGL
- 電動汽車驅動與控制技術
- Machine Learning with Spark(Second Edition)
- 大數據素質讀本
- 企業級Web開發實戰
- Moodle 2.0 Course Conversion(Second Edition)
- Appcelerator Titanium Smartphone App Development Cookbook(Second Edition)