Skip to content

Commit eace86d

Browse files
gokerakcVisualBean
authored andcommitted
fix: updated topic configuration data types
1 parent 4a6c6a8 commit eace86d

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/LEGO.AsyncAPI.Bindings/Kafka/KafkaChannelBinding.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ public class KafkaChannelBinding : ChannelBinding<KafkaChannelBinding>
4747
private static FixedFieldMap<TopicConfigurationObject> kafkaChannelTopicConfigurationObjectFixedFields = new ()
4848
{
4949
{ "cleanup.policy", (a, n) => { a.CleanupPolicy = n.CreateSimpleList(s => s.GetScalarValue()); } },
50-
{ "retention.ms", (a, n) => { a.RetentionMiliseconds = n.GetIntegerValue(); } },
50+
{ "retention.ms", (a, n) => { a.RetentionMilliseconds = n.GetIntegerValue(); } },
5151
{ "retention.bytes", (a, n) => { a.RetentionBytes = n.GetIntegerValue(); } },
52-
{ "delete.retention.ms", (a, n) => { a.DeleteRetentionMiliseconds = n.GetIntegerValue(); } },
52+
{ "delete.retention.ms", (a, n) => { a.DeleteRetentionMilliseconds = n.GetIntegerValue(); } },
5353
{ "max.message.bytes", (a, n) => { a.MaxMessageBytes = n.GetIntegerValue(); } },
5454
{ "confluent.key.schema.validation", (a, n) => { a.ConfluentKeySchemaValidation = n.GetBooleanValue(); } },
5555
{ "confluent.key.subject.name.strategy", (a, n) => { a.ConfluentKeySubjectName = n.GetScalarValue(); } },

src/LEGO.AsyncAPI.Bindings/Kafka/TopicConfigurationObject.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ public class TopicConfigurationObject : IAsyncApiElement
1717
/// <summary>
1818
/// The retention.ms configuration option.
1919
/// </summary>
20-
public int? RetentionMiliseconds { get; set; }
20+
public long? RetentionMilliseconds { get; set; }
2121

2222
/// <summary>
2323
/// The retention.bytes configuration option.
2424
/// </summary>
25-
public int? RetentionBytes { get; set; }
25+
public long? RetentionBytes { get; set; }
2626

2727
/// <summary>
2828
/// The delete.retention.ms configuration option.
2929
/// </summary>
30-
public int? DeleteRetentionMiliseconds { get; set; }
30+
public long? DeleteRetentionMilliseconds { get; set; }
3131

3232
/// <summary>
3333
/// The max.message.bytes configuration option.
@@ -63,10 +63,10 @@ public void Serialize(IAsyncApiWriter writer)
6363

6464
writer.WriteStartObject();
6565
writer.WriteOptionalCollection(AsyncApiConstants.CleanupPolicy, this.CleanupPolicy, (w, s) => w.WriteValue(s));
66-
writer.WriteOptionalProperty<int>(AsyncApiConstants.RetentionMiliseconds, this.RetentionMiliseconds);
67-
writer.WriteOptionalProperty<int>(AsyncApiConstants.RetentionBytes, this.RetentionBytes);
68-
writer.WriteOptionalProperty<int>(AsyncApiConstants.DeleteRetentionMiliseconds, this.DeleteRetentionMiliseconds);
69-
writer.WriteOptionalProperty<int>(AsyncApiConstants.MaxMessageBytes, this.MaxMessageBytes);
66+
writer.WriteOptionalProperty(AsyncApiConstants.RetentionMilliseconds, this.RetentionMilliseconds);
67+
writer.WriteOptionalProperty(AsyncApiConstants.RetentionBytes, this.RetentionBytes);
68+
writer.WriteOptionalProperty(AsyncApiConstants.DeleteRetentionMilliseconds, this.DeleteRetentionMilliseconds);
69+
writer.WriteOptionalProperty(AsyncApiConstants.MaxMessageBytes, this.MaxMessageBytes);
7070
writer.WriteOptionalProperty<bool>(AsyncApiConstants.ConfluentKeySchemaValidation, this.ConfluentKeySchemaValidation);
7171
writer.WriteOptionalProperty(AsyncApiConstants.ConfluentKeySubjectName, this.ConfluentKeySubjectName);
7272
writer.WriteOptionalProperty<bool>(AsyncApiConstants.ConfluentValueSchemaValidation, this.ConfluentValueSchemaValidation);

src/LEGO.AsyncAPI/Models/AsyncApiConstants.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ public static class AsyncApiConstants
132132
public const string ServerVariables = "serverVariables";
133133
public const string MessageId = "messageId";
134134
public const string CleanupPolicy = "cleanup.policy";
135-
public const string RetentionMiliseconds = "retention.ms";
135+
public const string RetentionMilliseconds = "retention.ms";
136136
public const string RetentionBytes = "retention.bytes";
137-
public const string DeleteRetentionMiliseconds = "delete.retention.ms";
137+
public const string DeleteRetentionMilliseconds = "delete.retention.ms";
138138
public const string MaxMessageBytes = "max.message.bytes";
139139
public const string ConfluentKeySchemaValidation = "confluent.key.schema.validation";
140140
public const string ConfluentKeySubjectName = "confluent.key.subject.name.strategy";

test/LEGO.AsyncAPI.Tests/Bindings/Kafka/KafkaBindings_Should.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void KafkaChannelBinding_WithFilledObject_SerializesAndDeserializes()
2727
cleanup.policy:
2828
- delete
2929
- compact
30-
retention.ms: 1
30+
retention.ms: 2592000000
3131
retention.bytes: 2
3232
delete.retention.ms: 3
3333
max.message.bytes: 4
@@ -45,9 +45,9 @@ public void KafkaChannelBinding_WithFilledObject_SerializesAndDeserializes()
4545
TopicConfiguration = new TopicConfigurationObject()
4646
{
4747
CleanupPolicy = new List<string> { "delete", "compact" },
48-
RetentionMiliseconds = 1,
48+
RetentionMilliseconds = 2592000000,
4949
RetentionBytes = 2,
50-
DeleteRetentionMiliseconds = 3,
50+
DeleteRetentionMilliseconds = 3,
5151
MaxMessageBytes = 4,
5252
ConfluentKeySchemaValidation = true,
5353
ConfluentKeySubjectName = "TopicNameStrategy",

0 commit comments

Comments
 (0)