Example #1
0
        public virtual RabbitChannelGroupConfiguration WithDispatchTable(IDispatchTable table)
        {
            if (table == null)
            {
                throw new ArgumentNullException("table");
            }

            this.DispatchTable = table;
            return(this);
        }
        public ServiceBusChannelGroupConfiguration WithDispatchTable(IDispatchTable dispatchTable)
        {
            if (dispatchTable == null)
            {
                throw new ArgumentNullException(nameof(dispatchTable));
            }

            DispatchTable = dispatchTable;
            return(this);
        }
		public RabbitChannelGroupConfiguration()
		{
			this.GroupName = DefaultGroupName;
			this.ApplicationId = DefaultAppId;
			this.ReceiveTimeout = DefaultReceiveTimeout;
			this.MinWorkers = this.MaxWorkers = DefaultWorkerCount;
			this.ChannelBuffer = DefaultChannelBuffer;
			this.MaxAttempts = DefaultMaxAttempts;
			this.TransactionType = RabbitTransactionType.Full;

			this.PoisonMessageExchange = new PublicationAddress(
				ExchangeType.Fanout, DefaultPoisonMessageExchange, string.Empty);
			this.DeadLetterExchange = new PublicationAddress(
				ExchangeType.Fanout, DefaultDeadLetterExchange, string.Empty);

			this.Serializer = DefaultSerializer;
			this.MessageAdapter = new RabbitMessageAdapter(this);
			this.DependencyResolver = null;
			this.DispatchOnly = true;
			this.DurableQueue = true;

			this.MessageBuilder = new DefaultChannelMessageBuilder();
			this.DispatchTable = DefaultDispatchTable;
		}
		public virtual RabbitChannelGroupConfiguration WithDispatchTable(IDispatchTable table)
		{
			if (table == null)
				throw new ArgumentNullException("table");

			this.DispatchTable = table;
			return this;
		}
		public DefaultDispatchContext(IMessagingChannel channel, IDispatchTable dispatchTable)
		{
			this.channel = channel;
			this.dispatchTable = dispatchTable;

			var config = channel.CurrentConfiguration;
			this.builder = config.MessageBuilder;
			this.returnAddress = config.ReturnAddress;
		}
		protected static void Build(IMessagingChannel channel, IDispatchTable dispatchTable)
		{
			dispatchContext = new DefaultDispatchContext(channel, dispatchTable);
		}