public KafkaDistributedEventBus(
        IServiceScopeFactory serviceScopeFactory,
        ICurrentTenant currentTenant,
        IUnitOfWorkManager unitOfWorkManager,
        IOptions <AbpKafkaEventBusOptions> abpKafkaEventBusOptions,
        IKafkaMessageConsumerFactory messageConsumerFactory,
        IOptions <AbpDistributedEventBusOptions> abpDistributedEventBusOptions,
        IKafkaSerializer serializer,
        IProducerPool producerPool,
        IGuidGenerator guidGenerator,
        IClock clock,
        IEventHandlerInvoker eventHandlerInvoker)
        : base(
            serviceScopeFactory,
            currentTenant,
            unitOfWorkManager,
            abpDistributedEventBusOptions,
            guidGenerator,
            clock,
            eventHandlerInvoker)
    {
        AbpKafkaEventBusOptions = abpKafkaEventBusOptions.Value;
        MessageConsumerFactory  = messageConsumerFactory;
        Serializer   = serializer;
        ProducerPool = producerPool;

        HandlerFactories = new ConcurrentDictionary <Type, List <IEventHandlerFactory> >();
        EventTypes       = new ConcurrentDictionary <string, Type>();
    }
Example #2
0
        public KafkaDistributedEventBus(
            IServiceScopeFactory serviceScopeFactory,
            ICurrentTenant currentTenant,
            IUnitOfWorkManager unitOfWorkManager,
            IOptions <AbpKafkaEventBusOptions> abpKafkaEventBusOptions,
            IKafkaMessageConsumerFactory messageConsumerFactory,
            IOptions <AbpDistributedEventBusOptions> abpDistributedEventBusOptions,
            IKafkaSerializer serializer,
            IProducerPool producerPool,
            IEventErrorHandler errorHandler,
            IOptions <AbpEventBusOptions> abpEventBusOptions)
            : base(serviceScopeFactory, currentTenant, unitOfWorkManager, errorHandler)
        {
            AbpKafkaEventBusOptions       = abpKafkaEventBusOptions.Value;
            AbpDistributedEventBusOptions = abpDistributedEventBusOptions.Value;
            AbpEventBusOptions            = abpEventBusOptions.Value;
            MessageConsumerFactory        = messageConsumerFactory;
            Serializer          = serializer;
            ProducerPool        = producerPool;
            DeadLetterTopicName =
                AbpEventBusOptions.DeadLetterName ?? AbpKafkaEventBusOptions.TopicName + "_dead_letter";

            HandlerFactories = new ConcurrentDictionary <Type, List <IEventHandlerFactory> >();
            EventTypes       = new ConcurrentDictionary <string, Type>();
        }
 public static KafkaProducer <object, object, TValue> Create <TValue>(
     KafkaBrokers brokers,
     IKafkaSerializer <TValue> valueSerializer)
 {
     return(new KafkaProducer <object, object, TValue>(brokers,
                                                       new NullSerializer <object>(),
                                                       valueSerializer,
                                                       new LoadBalancedPartitioner <object>()));
 }
 public static KafkaProducer <TKey, TPartitionKey, TValue> Create <TKey, TPartitionKey, TValue>(
     KafkaBrokers brokers,
     IKafkaSerializer <TKey> keySerializer,
     IKafkaSerializer <TValue> valueSerializer,
     IKafkaMessagePartitioner <TPartitionKey> partitioner)
 {
     return(new KafkaProducer <TKey, TPartitionKey, TValue>(
                brokers,
                keySerializer,
                valueSerializer,
                partitioner));
 }
 public static KafkaProducer <TKey, TKey, TValue> Create <TKey, TValue>(
     KafkaBrokers brokers,
     IKafkaSerializer <TKey> keySerializer,
     IKafkaSerializer <TValue> valueSerializer
     )
 {
     return(new KafkaProducer <TKey, TKey, TValue>(
                brokers,
                keySerializer,
                valueSerializer,
                new LoadBalancedPartitioner <TKey>()));
 }
Example #6
0
        public KafkaDistributedEventBus(
            IServiceScopeFactory serviceScopeFactory,
            ICurrentTenant currentTenant,
            IOptions <AbpKafkaEventBusOptions> abpKafkaEventBusOptions,
            IKafkaMessageConsumerFactory messageConsumerFactory,
            IOptions <AbpDistributedEventBusOptions> abpDistributedEventBusOptions,
            IKafkaSerializer serializer,
            IProducerPool producerPool)
            : base(serviceScopeFactory, currentTenant)
        {
            AbpKafkaEventBusOptions       = abpKafkaEventBusOptions.Value;
            AbpDistributedEventBusOptions = abpDistributedEventBusOptions.Value;
            MessageConsumerFactory        = messageConsumerFactory;
            Serializer   = serializer;
            ProducerPool = producerPool;

            HandlerFactories = new ConcurrentDictionary <Type, List <IEventHandlerFactory> >();
            EventTypes       = new ConcurrentDictionary <string, Type>();
        }
Example #7
0
 public AvroSerializer(IKafkaSerializer kafkaSerializer, string topic, bool isKey)
 {
     _kafkaSerializer = kafkaSerializer;
     _topic           = topic;
     _isKey           = isKey;
 }
Example #8
0
 public AvroDeserializer(IKafkaSerializer kafkaSerializer)
 {
     _kafkaSerializer = kafkaSerializer;
 }
Example #9
0
 public ConfluentKafkaSerializerAdapter(IKafkaSerializer kafkaSerializer)
 {
     _kafkaSerializer = kafkaSerializer;
 }
Example #10
0
 public static KafkaConsumer <TKey, TValue> Create <TKey, TValue>(string consumerGroup, KafkaBrokers brokers,
                                                                  IKafkaSerializer <TKey> keySerializer,
                                                                  IKafkaSerializer <TValue> valueSerializer, params TopicSelector[] topics)
 {
     return(new KafkaConsumer <TKey, TValue>(consumerGroup, brokers, keySerializer, valueSerializer, topics));
 }
Example #11
0
 public static KafkaConsumer <object, TValue> Create <TValue>(string consumerGroup, KafkaBrokers brokers,
                                                              IKafkaSerializer <TValue> valueSerializer, params TopicSelector[] topics)
 {
     return(new KafkaConsumer <object, TValue>(consumerGroup, brokers, new NullSerializer <object>(), valueSerializer, topics));
 }