Пример #1
0
        /// <summary>
        /// 生产者
        /// </summary>
        /// <typeparam name="T">消息类型</typeparam>
        /// <param name="queue">队列名称</param>
        /// <param name="messageObj">消息对象</param>
        /// <param name="markcode">消息的标记码</param>
        /// <param name="exchange">RabbitMq的Exchange名称</param>
        public static void Producer <T>(string queue, T messageObj, string markcode = null, string exchange = "") where T : class, new()
        {
            var sendMessage = EventMessageFactory.CreageEventMessageInstance(messageObj, markcode);

            RabbitMqClient.RabbitMqClient.Instance.TriggerEventMessage(sendMessage, queue, exchange);
        }