public void EventHubShouldHaveCorrectPath() { var attribute = new EventHubAttribute("queue1"); var jObject = attribute.ToJObject(); jObject.Should().HaveElement("path"); jObject["path"].Should().Be("queue1"); }
async Task <ISendTransport> ISendTransportProvider.GetSendTransport(Uri address) { var eventHubName = address.AbsolutePath.Trim('/'); var attribute = new EventHubAttribute(eventHubName); IAsyncCollector <EventData> collector = await _binder.BindAsync <IAsyncCollector <EventData> >(attribute, _cancellationToken).ConfigureAwait(false); var client = new CollectorEventDataSendEndpointContext(eventHubName, _log, collector, _cancellationToken); var source = new CollectorEventDataSendEndpointContextSource(client); var transport = new EventHubSendTransport(source, address); return(transport); }
private IAsyncCollector <EventData> BuildFromAttribute(EventHubAttribute attribute) { EventHubProducerClient client = _options.Value.GetEventHubProducerClient(attribute.EventHubName, attribute.Connection); return(new EventHubAsyncCollector(new EventHubProducerClientImpl(client, _loggerFactory))); }
private IAsyncCollector <EventData> BuildFromAttribute(EventHubAttribute attribute) { EventHubClient client = _options.Value.GetEventHubClient(attribute.EventHubName, attribute.Connection); return(new EventHubAsyncCollector(client)); }