示例#1
0
        public async Task <IAnonymousProducer> CreateAnonymousProducer(AnonymousProducerConfiguration configuration, CancellationToken cancellationToken)
        {
            var session = await CreateSession(cancellationToken).ConfigureAwait(false);

            var producerBuilder = new AnonymousProducerBuilder(_loggerFactory, _transactionsManager, session);

            return(await producerBuilder.CreateAsync(configuration, cancellationToken).ConfigureAwait(false));
        }
        public static Task <IAnonymousProducer> CreateAnonymousProducer(this IConnection connection, CancellationToken cancellationToken = default)
        {
            var configuration = new AnonymousProducerConfiguration();

            return(connection.CreateAnonymousProducer(configuration, cancellationToken));
        }