官术网_书友最值得收藏!

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!
主站蜘蛛池模板: 宕昌县| 遵化市| 遂宁市| 佛山市| 宣武区| 临城县| 克什克腾旗| 桓仁| 丹巴县| 峨眉山市| 禄劝| 景宁| 中江县| 宝山区| 新晃| 石泉县| 金沙县| 天镇县| 贺州市| 德化县| 锦屏县| 沙河市| 武汉市| 桃园市| 高尔夫| 黔东| 萨迦县| 泌阳县| 鹤峰县| 陇川县| 乌拉特前旗| 澎湖县| 金溪县| 浙江省| 宁强县| 鱼台县| 鹤峰县| 西和县| 郓城县| 科技| 甘肃省|