Esempio n. 1
0
        private void ModelOnBasicReturn(object sender, BasicReturnEventArgs args)
        {
            if (LogAdapter.LogEnabled)
            {
                LogAdapter.LogDebug("RabbitChannel",
                                    "Message dropped. Message sent to exchange " + args.Exchange + " with routing key " + args.RoutingKey,
                                    null);
            }

            var ev = this.MessageUnrouted;

            if (ev == null)
            {
                return;
            }

            var envelope  = new MessageEnvelope(args.BasicProperties, args.Body);
            var eventArgs = new     MessageUnroutedEventArgs()
            {
                MessageEnvelope = envelope,
                Exchange        = args.Exchange,
                ReplyCode       = args.ReplyCode,
                ReplyText       = args.ReplyText,
                RoutingKey      = args.RoutingKey
            };

            ev(eventArgs);
        }
Esempio n. 2
0
		private	void ModelOnBasicReturn(object sender, BasicReturnEventArgs	args)
		{
			if (LogAdapter.LogEnabled)
			{
				LogAdapter.LogDebug("RabbitChannel", 
					"Message dropped. Message sent to exchange " + args.Exchange + " with routing key "	+ args.RoutingKey, 
					null);
			}

			var	ev = this.MessageUnrouted;
			if (ev == null)	return;

			var	envelope = new MessageEnvelope(args.BasicProperties, args.Body);
			var	eventArgs =	new	MessageUnroutedEventArgs()
			{
				MessageEnvelope	= envelope,
				Exchange = args.Exchange,
				ReplyCode =	args.ReplyCode,
				ReplyText =	args.ReplyText,
				RoutingKey = args.RoutingKey
			};
				
			ev(eventArgs);
		}