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

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!
主站蜘蛛池模板: 浦江县| 丽江市| 泾川县| 昌都县| 绍兴县| 红原县| 西宁市| 彰武县| 洮南市| 遂昌县| 抚远县| 闽侯县| 枣庄市| 巩义市| 咸宁市| 紫金县| 仪征市| 肇州县| 鄂托克旗| 壤塘县| 错那县| 麦盖提县| 治多县| 武功县| 漯河市| 海晏县| 金门县| 湘西| 开远市| 茶陵县| 徐汇区| 长宁区| 城固县| 龙口市| 牟定县| 霍林郭勒市| 平罗县| 盐源县| 原阳县| 加查县| 墨江|