-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPulsarWebsocketMessage.cs
48 lines (41 loc) · 1.47 KB
/
PulsarWebsocketMessage.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
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace Snd.Sdk.Storage.Streaming.Models;
/// <summary>
/// Represents a message received through an Apache Pulsar Websocket connection.
/// Includes information such as the message ID, payload, properties, publish time, redelivery count, and key.
/// </summary>
public record PulsarWebsocketMessage
{
/// <summary>
/// Gets or sets the identifier of the message.
/// </summary>
[JsonPropertyName("messageId")]
public string MessageId { get; set; }
/// <summary>
/// Gets or sets the payload of the message.
/// </summary>
[JsonPropertyName("payload")]
public string Payload { get; set; }
/// <summary>
/// Gets or sets the properties of the message.
/// </summary>
[JsonPropertyName("properties")]
public Dictionary<string, string> Properties { get; set; }
/// <summary>
/// Gets or sets the time when the message was published.
/// </summary>
[JsonPropertyName("publishTime")]
public DateTime PublishTime { get; set; }
/// <summary>
/// Gets or sets the count of how many times the message has been redelivered.
/// </summary>
[JsonPropertyName("redeliveryCount")]
public int RedeliveryCount { get; set; }
/// <summary>
/// Gets or sets the key of the message.
/// </summary>
[JsonPropertyName("key")]
public string Key { get; set; }
}