static void Main(string[] args) { var bus = RabbitHutch.CreateBus("host=localhost").Advanced; var queue = bus.QueueDeclare("emailsubscriptionAdvanced"); var exchange = bus.ExchangeDeclare("myAdvancedExchange", ExchangeType.Direct); bus.Bind(exchange, queue, "#"); for (int i = 0; i < 10; i++) { using (var publishChannel = bus.OpenPublishChannel()) { var message = new Message<ENQMessage>(new ENQMessage() { Name = i + "bill", LastName = i + "baggins", EmailAddress = i + "*****@*****.**" }); publishChannel.Publish<ENQMessage>(exchange, "#", message); } } bus.Dispose(); }
/// <summary> /// Deprecated Method for adding a new object to the Message EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToMessage(Message message) { base.AddObject("Message", message); }
/// <summary> /// Create a new Message object. /// </summary> /// <param name="messageID">Initial value of the MessageID property.</param> public static Message CreateMessage(global::System.Int32 messageID) { Message message = new Message(); message.MessageID = messageID; return message; }