-
Notifications
You must be signed in to change notification settings - Fork 475
/
KafkaEvent.cs
79 lines (67 loc) · 2.32 KB
/
KafkaEvent.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
namespace Amazon.Lambda.KafkaEvents
{
using System.Collections.Generic;
using System.IO;
/// <summary>
/// Apache Kafka event
/// https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html
/// https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html
/// </summary>
public class KafkaEvent
{
/// <summary>
/// The source of the event.
/// </summary>
public string EventSource { get; set; }
/// <summary>
/// The ARN of the event source.
/// </summary>
public string EventSourceArn { get; set; }
/// <summary>
/// Initial list of brokers as a CSV list of broker host or host:port.
/// </summary>
public string BootstrapServers { get; set; }
/// <summary>
/// List of Kafka event records.
/// </summary>
public IDictionary<string, IList<KafkaEventRecord>> Records { get; set; }
/// <summary>
/// Kafka event record.
/// </summary>
public class KafkaEventRecord
{
/// <summary>
/// The topic associated with the event record.
/// </summary>
public string Topic { get; set; }
/// <summary>
/// The partition associated with the event record.
/// </summary>
public int Partition { get; set; }
/// <summary>
/// The partition offset associated with the event record.
/// </summary>
public long Offset { get; set; }
/// <summary>
/// The Kafka event record timestamp.
/// </summary>
public long Timestamp { get; set; }
/// <summary>
/// The Kafka event record timestamp type.
/// </summary>
public string TimestampType { get; set; }
/// <summary>
/// The Kafka event record Key.
/// </summary>
public string Key { get; set; }
/// <summary>
/// The Kafka event record Value.
/// </summary>
public MemoryStream Value { get; set; }
/// <summary>
/// The Kafka event record headers.
/// </summary>
public IList<IDictionary<string, sbyte[]>> Headers { get; set; }
}
}
}