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

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!
主站蜘蛛池模板: 通江县| 方山县| 亚东县| 常德市| 家居| 荔波县| 兰溪市| 克拉玛依市| 漳州市| 金堂县| 济宁市| 武义县| 徐州市| 五指山市| 绵阳市| 贵溪市| 临江市| 新泰市| 乐清市| 山丹县| 彩票| 博客| 沅陵县| 连城县| 新泰市| 龙胜| 金坛市| 南漳县| 贺兰县| 永宁县| 涞水县| 武功县| 阿荣旗| 海门市| 吴旗县| 彩票| 金阳县| 平乐县| 大埔区| 察雅县| 肥城市|