/// <summary>生产消息</summary> /// <param name="job">作业</param> /// <param name="topic">主题</param> /// <param name="messages">消息集合</param> /// <param name="option">消息选项</param> /// <returns></returns> public override Int32 Produce(String job, String topic, String[] messages, MessageOption option = null) { if (topic.IsNullOrEmpty() || messages == null || messages.Length < 1) { return(0); } return(Ant.Produce(job, topic, messages, option)); }
/// <summary>生产消息</summary> /// <param name="job">作业</param> /// <param name="topic">主题</param> /// <param name="messages">消息集合</param> /// <param name="option">消息选项</param> /// <returns></returns> public Int32 Produce(String job, String topic, String[] messages, MessageOption option = null) { var dic = new { job, topic, messages }.ToDictionary(); if (option != null) { dic = dic.Merge(option); } return(Invoke <Int32>(nameof(Produce), dic)); }
/// <summary>生产消息</summary> /// <param name="job">作业</param> /// <param name="topic">主题</param> /// <param name="messages">消息集合</param> /// <param name="option">消息选项</param> /// <returns></returns> public override Int32 Produce(String job, String topic, String[] messages, MessageOption option = null) { if (topic.IsNullOrEmpty() || messages == null || messages.Length < 1) { return(0); } var model = new ProduceModel { Job = job, Topic = topic, Messages = messages, }; if (option != null) { model.DelayTime = option.DelayTime; model.Unique = option.Unique; } return(Ant.Produce(model)); }
/// <summary>生产消息</summary> /// <param name="job">作业</param> /// <param name="topic">主题</param> /// <param name="messages">消息集合</param> /// <param name="option">消息选项</param> /// <returns></returns> public virtual Int32 Produce(String job, String topic, String[] messages, MessageOption option = null) => 0;