Skip to content

Commit

Permalink
Regenerate configs upon consumer/producer creation
Browse files Browse the repository at this point in the history
  • Loading branch information
NooNameR authored and phatboyg committed Apr 21, 2023
1 parent 863d71d commit d942b67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ public void SetHeadersSerializer(IHeadersSerializer serializer)

public KafkaSendTransportContext<TKey, TValue> CreateSendTransportContext(IBusInstance busInstance, Action onStop = null)
{
var producerConfig = _hostConfiguration.GetProducerConfig(_producerConfig);

ProducerBuilder<byte[], byte[]> CreateProducerBuilder()
{
var producerConfig = _hostConfiguration.GetProducerConfig(_producerConfig);

ProducerBuilder<byte[], byte[]> producerBuilder = new ProducerBuilder<byte[], byte[]>(producerConfig)
.SetKeySerializer(Serializers.ByteArray)
.SetValueSerializer(Serializers.ByteArray);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,10 @@ public override ReceiveEndpointContext CreateReceiveEndpointContext()

KafkaReceiveEndpointContext<TKey, TValue> CreateReceiveKafkaEndpointContext()
{
var consumerConfig = _hostConfiguration.GetConsumerConfig(_consumerConfig);

ConsumerBuilder<byte[], byte[]> CreateConsumerBuilder()
{
var consumerConfig = _hostConfiguration.GetConsumerConfig(_consumerConfig);

ConsumerBuilder<byte[], byte[]> consumerBuilder = new ConsumerBuilder<byte[], byte[]>(consumerConfig)
.SetLogHandler((c, message) => _busInstance.HostConfiguration.ReceiveLogContext?.Debug?.Log(message.Message));

Expand All @@ -222,7 +222,7 @@ ConsumerBuilder<byte[], byte[]> CreateConsumerBuilder()
return consumerBuilder;
}

var builder = new KafkaReceiveEndpointBuilder<TKey, TValue>(_busInstance, _hostConfiguration, consumerConfig.GroupId, this,
var builder = new KafkaReceiveEndpointBuilder<TKey, TValue>(_busInstance, _hostConfiguration, _consumerConfig.GroupId, this,
this, _headersDeserializer, _keyDeserializer, _valueDeserializer, CreateConsumerBuilder);
ApplySpecifications(builder);

Expand Down

0 comments on commit d942b67

Please sign in to comment.