示例#1
0
        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();
        }
示例#2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Message EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMessage(Message message)
 {
     base.AddObject("Message", message);
 }
示例#3
0
 /// <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;
 }