Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5f7e12f
ReadOnlySpan for internal Produce methods
alec-anikin Mar 2, 2021
b3338ea
IReadOnlyCollection for headers
alec-anikin Mar 3, 2021
353e36b
LangVersion 7.3
alec-anikin Mar 3, 2021
e5f1abf
Split producers
alec-anikin Apr 15, 2021
8881fb9
Fix comments
alec-anikin Apr 23, 2021
45849eb
Integration tests
alec-anikin Apr 30, 2021
01f6d3d
Fixes
alec-anikin May 3, 2021
00089a5
Rename files to simplify review
alec-anikin May 3, 2021
f38d28c
TODO for rename
alec-anikin May 3, 2021
25ae394
Fixes
alec-anikin May 3, 2021
ef7c23f
Fix test build issue with 'default'
alec-anikin May 3, 2021
f1fddd9
Merge branch 'master' into producer_span_v2
alec-anikin Jun 25, 2021
c6282d1
Merge remote-tracking branch 'origin/master' into producer_span_v2
alec-anikin Oct 10, 2021
b3e893d
Merge remote-tracking branch 'origin/master' into producer_span_v2
alec-anikin Oct 22, 2021
7912ed8
Binary producer extensions for frequently used key types
alec-anikin Feb 6, 2022
744ffbf
Merge branch 'master' into producer_span_v2
alec-anikin Mar 26, 2022
933d0c2
Merge remote-tracking branch 'origin/master' into producer_span_v2
alec-anikin Jun 18, 2022
e57fae1
Merge remote-tracking branch 'origin/master' into producer_span_v2
alec-anikin Aug 28, 2022
b4af44e
Merge branch 'master' into producer_span_v2
alec-anikin Jan 4, 2023
e0548ab
Merge remote-tracking branch 'origin/master' into producer_span_v2
alec-anikin Feb 11, 2023
79ac18f
Merge branch 'master' into producer_span_v2
alec-anikin Sep 22, 2023
27fb058
Fix null headers issue
alec-anikin Sep 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/ConfigGen/ConfigGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>7.1</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
29 changes: 29 additions & 0 deletions src/Confluent.Kafka/DeliveryReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,35 @@

namespace Confluent.Kafka
{
/// <summary>
/// The result of a produce request.
/// </summary>
public class DeliveryReport : DeliveryResult
{
/// <summary>
/// An error (or NoError) associated with the message.
/// </summary>
public Error Error { get; set; }

/// <summary>
/// The TopicPartitionOffsetError associated with the message.
/// </summary>
public TopicPartitionOffsetError TopicPartitionOffsetError
{
get
{
return new TopicPartitionOffsetError(Topic, Partition, Offset, Error);
}
set
{
Topic = value.Topic;
Partition = value.Partition;
Offset = value.Offset;
Error = value.Error;
}
}
}

/// <summary>
/// The result of a produce request.
/// </summary>
Expand Down
33 changes: 23 additions & 10 deletions src/Confluent.Kafka/DeliveryResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Confluent.Kafka
/// <summary>
/// Encapsulates the result of a successful produce request.
/// </summary>
public class DeliveryResult<TKey, TValue>
public class DeliveryResult
{
/// <summary>
/// The topic associated with the message.
Expand Down Expand Up @@ -64,7 +64,24 @@ public TopicPartitionOffset TopicPartitionOffset
/// The persistence status of the message
/// </summary>
public PersistenceStatus Status { get; set; }


/// <summary>
/// The Kafka message timestamp.
/// </summary>
public virtual Timestamp Timestamp { get; set; }

/// <summary>
/// The Kafka message headers.
/// </summary>
public virtual Headers Headers { get; set; }
}


/// <summary>
/// Encapsulates the result of a successful produce request.
/// </summary>
public class DeliveryResult<TKey, TValue> : DeliveryResult
{
/// <summary>
/// The Kafka message.
/// </summary>
Expand All @@ -88,19 +105,15 @@ public TValue Value
set { Message.Value = value; }
}

/// <summary>
/// The Kafka message timestamp.
/// </summary>
public Timestamp Timestamp
/// <inheritdoc />
public override Timestamp Timestamp
{
get { return Message.Timestamp; }
set { Message.Timestamp = value; }
}

/// <summary>
/// The Kafka message headers.
/// </summary>
public Headers Headers
/// <inheritdoc />
public override Headers Headers
{
get { return Message.Headers; }
set { Message.Headers = value; }
Expand Down
39 changes: 33 additions & 6 deletions src/Confluent.Kafka/DependentProducerBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,47 @@
namespace Confluent.Kafka
{
/// <summary>
/// A builder class for <see cref="IProducer{TKey, TValue}" /> instance
/// A builder class for <see cref="IProducer" /> instance
/// implementations that leverage an existing client handle.
///
/// [API-SUBJECT-TO-CHANGE] - This class may be removed in the future
/// in favor of an improved API for this functionality.
/// </summary>
public class DependentProducerBuilder<TKey, TValue>
public class DependentProducerBuilder
{
/// <summary>
/// The configured client handle.
/// </summary>
public Handle Handle { get; set; }


/// <summary>
/// An underlying librdkafka client handle that the Producer will use to
/// make broker requests. The handle must be from another Producer
/// instance (not Consumer or AdminClient).
/// </summary>
public DependentProducerBuilder(Handle handle)
{
this.Handle = handle;
}

/// <summary>
/// Build a new IProducer implementation instance.
/// </summary>
public virtual IProducer Build()
{
return new Producer(this);
}
}

/// <summary>
/// A builder class for <see cref="IProducer{TKey, TValue}" /> instance
/// implementations that leverage an existing client handle.
///
/// [API-SUBJECT-TO-CHANGE] - This class may be removed in the future
/// in favor of an improved API for this functionality.
/// </summary>
public class DependentProducerBuilder<TKey, TValue> : DependentProducerBuilder
{
/// <summary>
/// The configured key serializer.
/// </summary>
Expand All @@ -60,9 +88,8 @@ public class DependentProducerBuilder<TKey, TValue>
/// make broker requests. The handle must be from another Producer
/// instance (not Consumer or AdminClient).
/// </summary>
public DependentProducerBuilder(Handle handle)
public DependentProducerBuilder(Handle handle) : base(handle)
{
this.Handle = handle;
}

/// <summary>
Expand Down Expand Up @@ -104,7 +131,7 @@ public DependentProducerBuilder<TKey, TValue> SetValueSerializer(IAsyncSerialize
/// <summary>
/// Build a new IProducer implementation instance.
/// </summary>
public virtual IProducer<TKey, TValue> Build()
public new virtual IProducer<TKey, TValue> Build()
{
return new Producer<TKey, TValue>(this);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Confluent.Kafka/Headers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Confluent.Kafka
/// <remarks>
/// Message headers are supported by v0.11 brokers and above.
/// </remarks>
public class Headers : IEnumerable<IHeader>
public class Headers : IReadOnlyCollection<IHeader>
{
private readonly List<IHeader> headers = new List<IHeader>();

Expand Down
2 changes: 1 addition & 1 deletion src/Confluent.Kafka/IConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ public interface IConsumer<TKey, TValue> : IClient
/// The current consumer group metadata associated with this consumer,
/// or null if a GroupId has not been specified for the consumer.
/// This metadata object should be passed to the transactional producer's
/// <see cref="IProducer{K,V}.SendOffsetsToTransaction(IEnumerable{TopicPartitionOffset},IConsumerGroupMetadata,TimeSpan)"/>
/// <see cref="ITransactionalProducer.SendOffsetsToTransaction(IEnumerable{TopicPartitionOffset},IConsumerGroupMetadata,TimeSpan)"/>
/// method.
/// </summary>
IConsumerGroupMetadata ConsumerGroupMetadata { get; }
Expand Down
Loading