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

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!
主站蜘蛛池模板: 湛江市| 洛宁县| 方正县| 镇安县| 甘孜| 临潭县| 宁阳县| 汾阳市| 台北市| 慈利县| 阜阳市| 成安县| 泸水县| 福鼎市| 锡林郭勒盟| 大宁县| 阳朔县| 山阴县| 剑川县| 三穗县| 福清市| 长岭县| 儋州市| 龙泉市| 九龙坡区| 靖安县| 新兴县| 清河县| 罗山县| 马尔康县| 佛学| 孟津县| 西充县| 精河县| 如东县| 江都市| 华蓥市| 内江市| 大冶市| 含山县| 磐石市|