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

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!
主站蜘蛛池模板: 来宾市| 新和县| 登封市| 喀什市| 安宁市| 长沙县| 察雅县| 南川市| 武川县| 石首市| 卓尼县| 新蔡县| 星子县| 常德市| 梧州市| 仪陇县| 土默特左旗| 德清县| 淮滨县| 宿迁市| 灵川县| 河间市| 云梦县| 沽源县| 南岸区| 安康市| 苍山县| 德阳市| 宜兴市| 卓资县| 开远市| 彰化市| 大同市| 玉溪市| 芒康县| 吴忠市| 余姚市| 北流市| 安宁市| 额敏县| 鹰潭市|