public KafkaMessageReceiver(ReceiveEndpointContext context, IConsumerLockContext <TKey, TValue> lockContext, IHeadersDeserializer headersDeserializer) { _context = context; _lockContext = lockContext; _headersDeserializer = headersDeserializer; _dispatcher = context.CreateReceivePipeDispatcher(); }
public ReceiveTransportAgent(GrpcReceiveEndpointContext context, string queueName) { _context = context; _queueName = queueName; _dispatcher = context.CreateReceivePipeDispatcher(); var outputOptions = new BoundedChannelOptions(context.PrefetchCount) { SingleWriter = true, SingleReader = true, AllowSynchronousContinuations = true }; _channel = Channel.CreateBounded <GrpcTransportMessage>(outputOptions); if (context.ConcurrentMessageLimit.HasValue) { _limiter = new ConcurrencyLimiter(context.ConcurrentMessageLimit.Value); } _consumeDispatcher = Task.Run(() => StartDispatcher()); var startup = Task.Run(() => Startup()); SetReady(startup); }
public MediatorSendEndpoint(IReceiveEndpointConfiguration configuration, IReceivePipeDispatcher dispatcher, ILogContext logContext, SendObservable sendObservers, IReceiveEndpointConfiguration sourceConfiguration, IReceivePipeDispatcher sourceDispatcher) : this(configuration, dispatcher, logContext, sendObservers) { _sourceAddress = sourceConfiguration.InputAddress; _sourceEndpoint = new MediatorSendEndpoint(sourceConfiguration, sourceDispatcher, logContext, sendObservers); }
public InMemoryReceiveTransport(Uri inputAddress, IInMemoryQueue queue, ReceiveEndpointContext context) { _inputAddress = inputAddress; _queue = queue; _context = context; _dispatcher = context.CreateReceivePipeDispatcher(); }
public ReceiveTransportAgent(InMemoryReceiveEndpointContext context, IInMemoryQueue queue) { _context = context; _queue = queue; _dispatcher = context.CreateReceivePipeDispatcher(); _consumerHandle = queue.ConnectConsumer(this); Task.Run(() => Startup()); }
public Mediator(ILogContext logContext, IReceiveEndpointConfiguration configuration, IReceivePipeDispatcher dispatcher, IInMemoryReceiveEndpointConfiguration responseConfiguration, IReceivePipeDispatcher responseDispatcher) { var sendObservable = new SendObservable(); _endpoint = new MediatorSendEndpoint(configuration, dispatcher, logContext, sendObservable, responseConfiguration, responseDispatcher); var clientFactoryContext = new MediatorClientFactoryContext(_endpoint, responseConfiguration.ConsumePipe, responseConfiguration.InputAddress); _clientFactory = new ClientFactory(clientFactoryContext); }
/// <summary> /// The basic consumer receives messages pushed from the broker. /// </summary> /// <param name="model">The model context for the consumer</param> /// <param name="context">The topology</param> public RabbitMqBasicConsumer(ModelContext model, RabbitMqReceiveEndpointContext context) { _model = model; _context = context; _receiveSettings = model.GetPayload <ReceiveSettings>(); _pending = new ConcurrentDictionary <ulong, RabbitMqReceiveContext>(); _dispatcher = context.CreateReceivePipeDispatcher(); _dispatcher.ZeroActivity += HandleDeliveryComplete; _deliveryComplete = TaskUtil.GetTask <bool>(); }
MediatorSendEndpoint(IReceiveEndpointConfiguration configuration, IReceivePipeDispatcher dispatcher, ILogContext logContext, SendObservable sendObservers) { _dispatcher = dispatcher; _logContext = logContext; _sendObservers = sendObservers; _destinationAddress = configuration.InputAddress; _publishTopology = configuration.Topology.Publish; _receiveObservers = configuration.ReceiveObservers; _sendPipe = configuration.Send.CreatePipe(); _publishSendEndpoint = new MediatorPublishSendEndpoint(this, configuration.Publish.CreatePipe()); }
/// <summary> /// The basic consumer receives messages pushed from the broker. /// </summary> /// <param name="client">The model context for the consumer</param> /// <param name="context">The topology</param> public AmazonSqsMessageReceiver(ClientContext client, SqsReceiveEndpointContext context) { _client = client; _context = context; _receiveSettings = client.GetPayload <ReceiveSettings>(); _deliveryComplete = TaskUtil.GetTask <bool>(); _dispatcher = context.CreateReceivePipeDispatcher(); _dispatcher.ZeroActivity += HandleDeliveryComplete; Task.Run(Consume); }
public EventHubDataReceiver(ReceiveEndpointContext context, ProcessorContext processorContext) { _context = context; _processorContext = processorContext; _deliveryComplete = TaskUtil.GetTask <bool>(); _dispatcher = context.CreateReceivePipeDispatcher(); _dispatcher.ZeroActivity += HandleDeliveryComplete; var prefetchCount = Math.Max(1000, processorContext.ReceiveSettings.CheckpointMessageCount / 10); _executor = new ChannelExecutor(prefetchCount, processorContext.ReceiveSettings.ConcurrencyLimit); }
public KafkaMessageReceiver(ReceiveEndpointContext context, ConsumerContext <TKey, TValue> consumerContext) { _context = context; _consumerContext = consumerContext; _cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(Stopping); _consumerContext.ErrorHandler += HandleKafkaError; _deliveryComplete = TaskUtil.GetTask <bool>(); _dispatcher = context.CreateReceivePipeDispatcher(); _dispatcher.ZeroActivity += HandleDeliveryComplete; Task.Run(Consume); }
/// <summary> /// The basic consumer receives messages pushed from the broker. /// </summary> /// <param name="client">The model context for the consumer</param> /// <param name="context">The topology</param> public AmazonSqsBasicConsumer(ClientContext client, SqsReceiveEndpointContext context) { _client = client; _context = context; _receiveSettings = client.GetPayload <ReceiveSettings>(); _pending = new ConcurrentDictionary <string, AmazonSqsReceiveContext>(); _deliveryComplete = TaskUtil.GetTask <bool>(); _dispatcher = context.CreateReceivePipeDispatcher(); _dispatcher.ZeroActivity += HandleDeliveryComplete; SetReady(); }
/// <summary> /// The basic consumer receives messages pushed from the broker. /// </summary> /// <param name="session">The model context for the consumer</param> /// <param name="messageConsumer"></param> /// <param name="context">The topology</param> public ActiveMqBasicConsumer(SessionContext session, IMessageConsumer messageConsumer, ActiveMqReceiveEndpointContext context) { _session = session; _messageConsumer = messageConsumer; _context = context; _receiveSettings = session.GetPayload <ReceiveSettings>(); _deliveryComplete = TaskUtil.GetTask <bool>(); _dispatcher = context.CreateReceivePipeDispatcher(); _dispatcher.ZeroActivity += HandleDeliveryComplete; messageConsumer.Listener += HandleMessage; SetReady(); }
/// <summary> /// The basic consumer receives messages pushed from the broker. /// </summary> /// <param name="model">The model context for the consumer</param> /// <param name="context">The topology</param> public RabbitMqBasicConsumer(ModelContext model, RabbitMqReceiveEndpointContext context) { _model = model; _context = context; _receiveSettings = model.GetPayload <ReceiveSettings>(); _pending = new ConcurrentDictionary <ulong, RabbitMqReceiveContext>(); _dispatcher = context.CreateReceivePipeDispatcher(); _dispatcher.ZeroActivity += HandleDeliveryComplete; _executor = new ChannelExecutor(context.PrefetchCount, context.ConcurrentMessageLimit ?? context.PrefetchCount); _deliveryComplete = TaskUtil.GetTask <bool>(); ConsumerCancelled += OnConsumerCancelled; }
/// <summary> /// The basic consumer receives messages pushed from the broker. /// </summary> /// <param name="model">The model context for the consumer</param> /// <param name="context">The topology</param> public RabbitMqBasicConsumer(ModelContext model, RabbitMqReceiveEndpointContext context) { _model = model; _context = context; _receiveSettings = model.GetPayload <ReceiveSettings>(); _pending = new ConcurrentDictionary <ulong, RabbitMqReceiveContext>(); _dispatcher = context.CreateReceivePipeDispatcher(); _dispatcher.ZeroActivity += HandleDeliveryComplete; _deliveryComplete = TaskUtil.GetTask <bool>(); if (context.ConcurrentMessageLimit.HasValue) { _limit = new SemaphoreSlim(context.ConcurrentMessageLimit.Value); } ConsumerCancelled += OnConsumerCancelled; }
public EventHubDataReceiver(ReceiveEndpointContext context, IProcessorLockContext lockContext) { _context = context; _lockContext = lockContext; _dispatcher = context.CreateReceivePipeDispatcher(); }
public EventDataReceiver(ReceiveEndpointContext context) { _context = context; _dispatcher = context.CreateReceivePipeDispatcher(); }
public BrokeredMessageReceiver(ReceiveEndpointContext context) { _context = context; _dispatcher = context.CreateReceivePipeDispatcher(); }
public EventDataReceiver(ReceiveEndpointContext context) { _context = context; _dispatcher = new ReceivePipeDispatcher(_context.ReceivePipe, _context.ReceiveObservers, _context.LogContext); }