public IEventHubProducer GetProducer(Uri address)
        {
            var endpointAddress = new EventHubEndpointAddress(_context.HostAddress, address);
            var client          = _context.CreateEventHubClient(endpointAddress.EventHubName);
            var context         = new EventHubProducerContext(client, _context);

            return(new EventHubProducer(endpointAddress, context, _consumeContext));
        }
Example #2
0
 public EventHubTransportContext(IEventHubHostConfiguration hostConfiguration, ISendPipe sendPipe,
                                 IHostConfiguration configuration, Uri endpointAddress, IMessageSerializer messageSerializer)
     : base(configuration)
 {
     _configuration             = configuration;
     SendPipe                   = sendPipe;
     EndpointAddress            = new EventHubEndpointAddress(HostAddress, endpointAddress);
     _producerContextSupervisor =
         new Recycle <IProducerContextSupervisor>(() =>
                                                  new ProducerContextSupervisor(hostConfiguration.ConnectionContextSupervisor, EndpointAddress.EventHubName, messageSerializer));
 }
Example #3
0
 public EventHubProducer(EventHubEndpointAddress topicAddress, IEventHubProducerContext context, ConsumeContext consumeContext = null)
 {
     _topicAddress   = topicAddress;
     _context        = context;
     _consumeContext = consumeContext;
 }