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

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!
主站蜘蛛池模板: 昌吉市| 大石桥市| 饶河县| 中江县| 洪江市| 奇台县| 库车县| 准格尔旗| 浏阳市| 英山县| 新野县| 邢台市| 富锦市| 三原县| 上犹县| 贵溪市| 凤山市| 黄山市| 石阡县| 桐城市| 平江县| 南岸区| 鄂托克旗| 新乡县| 兴仁县| 梁平县| 凤冈县| 温泉县| 明星| 澄城县| 汉寿县| 连城县| 吉首市| 江达县| 敖汉旗| 蛟河市| 盈江县| 丽江市| 临沂市| 徐州市| 阿克|