Пример #1
0
        public IProducer Create()
        {
            if (string.IsNullOrEmpty(_topic))
            {
                throw new ConfigurationException("ProducerOptions.Topic may not be null or empty");
            }

            var options = new ProducerOptions(_topic !)
            {
                InitialSequenceId = _initialSequenceId,
                ProducerName      = _producerName
            };

            return(_pulsarClient.CreateProducer(options));
        }
    }
Пример #2
0
        public IProducer Create()
        {
            if (string.IsNullOrEmpty(_topic))
            {
                throw new ConfigurationException("ProducerOptions.Topic may not be null or empty");
            }

            var options = new ProducerOptions(_topic !)
            {
                CompressionType     = _compressionType,
                InitialSequenceId   = _initialSequenceId,
                ProducerName        = _producerName,
                StateChangedHandler = _stateChangedHandler
            };

            return(_pulsarClient.CreateProducer(options));
        }
    }
Пример #3
0
        public IProducer <TMessage> Create()
        {
            if (string.IsNullOrEmpty(_topic))
            {
                throw new ConfigurationException("ProducerOptions.Topic may not be null or empty");
            }

            var options = new ProducerOptions <TMessage>(_topic !, _schema)
            {
                CompressionType     = _compressionType,
                InitialSequenceId   = _initialSequenceId,
                ProducerName        = _producerName,
                StateChangedHandler = _stateChangedHandler
            };

            if (_messageRouter is not null)
            {
                options.MessageRouter = _messageRouter;
            }

            return(_pulsarClient.CreateProducer(options));
        }
    }