Repository navigation
Expand file tree
/
Copy pathQueue.cs
More file actions
48 lines (42 loc) · 1.58 KB
/
Copy pathQueue.cs
File metadata and controls
48 lines (42 loc) · 1.58 KB
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
namespace ByteBard.AsyncAPI.Bindings.AMQP
{
using ByteBard.AsyncAPI.Models;
using ByteBard.AsyncAPI.Models.Interfaces;
using ByteBard.AsyncAPI.Writers;
/// <summary>
/// Represents a queue configuration.
/// </summary>
public class Queue : IAsyncApiElement
{
/// <summary>
/// The name of the queue. It MUST NOT exceed 255 characters long.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Whether the queue should survive broker restarts or not.
/// </summary>
public bool Durable { get; set; }
/// <summary>
/// Whether the queue should be used only by one connection or not.
/// </summary>
public bool Exclusive { get; set; }
/// <summary>
/// Whether the queue should be deleted when the last consumer unsubscribes.
/// </summary>
public bool AutoDelete { get; set; }
/// <summary>
/// The virtual host of the queue. Defaults to /.
/// </summary>
public string Vhost { get; set; } = "/";
public void Serialize(IAsyncApiWriter writer)
{
writer.WriteStartObject();
writer.WriteRequiredProperty(AsyncApiConstants.Name, this.Name);
writer.WriteRequiredProperty("durable", this.Durable);
writer.WriteRequiredProperty("exclusive", this.Exclusive);
writer.WriteRequiredProperty("autoDelete", this.AutoDelete);
writer.WriteRequiredProperty("vhost", this.Vhost);
writer.WriteEndObject();
}
}
}