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

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!
主站蜘蛛池模板: 南开区| 敦化市| 时尚| 西藏| 霸州市| 静海县| 阿尔山市| 扶余县| 玉屏| 峨眉山市| 台中市| 高清| 肇庆市| 诏安县| 崇阳县| 沈阳市| 武功县| 沈丘县| 通道| 临沂市| 武清区| 舟山市| 三台县| 阿拉善左旗| 定州市| 龙里县| 海城市| 太仆寺旗| 凤台县| 明溪县| 汉寿县| 金堂县| 乌鲁木齐市| 星子县| 渝中区| 六盘水市| 防城港市| 新泰市| 宝清县| 伊金霍洛旗| 平潭县|