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

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!
主站蜘蛛池模板: 玉溪市| 林芝县| 金乡县| 三台县| 连云港市| 宝山区| 蒙山县| 兰坪| 崇阳县| 昭通市| 镇赉县| 奈曼旗| 科技| 平乡县| 格尔木市| 静海县| 连山| 冀州市| 西乌珠穆沁旗| 阿坝县| 闽侯县| 壶关县| 霍山县| 环江| 宁都县| 满城县| 扎囊县| 仁化县| 时尚| 舒城县| 根河市| 皋兰县| 高雄市| 北海市| 南昌县| 临泉县| 东乌珠穆沁旗| 九寨沟县| 盈江县| 周口市| 平山县|