Exemplo n.º 1
0
        public KafkaAdapter(
            string providerName,
            KafkaStreamOptions options,
            IDictionary <string, QueueProperties> queueProperties,
            SerializationManager serializationManager,
            ILoggerFactory loggerFactory
            )
        {
            _options              = options;
            _queueProperties      = queueProperties;
            _serializationManager = serializationManager;
            _loggerFactory        = loggerFactory;
            _logger = _loggerFactory.CreateLogger <KafkaAdapter>();

            Name = providerName;

            _producer = new Producer <byte[], KafkaBatchContainer>(
                options.ToProducerProperties(),
                valueSerializer: (topic, container) => container.ToByteArray(_serializationManager)
                );
        }
Exemplo n.º 2
0
        public KafkaAdapter(
            string providerName,
            KafkaStreamOptions options,
            IDictionary <string, QueueProperties> queueProperties,
            SerializationManager serializationManager,
            ILoggerFactory loggerFactory,
            IGrainFactory grainFactory
            )
        {
            _options              = options;
            _queueProperties      = queueProperties;
            _serializationManager = serializationManager;
            _loggerFactory        = loggerFactory;
            _grainFactory         = grainFactory;
            _logger = _loggerFactory.CreateLogger <KafkaAdapter>();

            Name = providerName;

            _producer = new ProducerBuilder <byte[], KafkaBatchContainer>(options.ToProducerProperties())
                        .SetValueSerializer(new KafkaBatchContainerSerializer(serializationManager))
                        .Build();
        }