-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathTopicAttribute.cs
More file actions
55 lines (46 loc) · 1.86 KB
/
TopicAttribute.cs
File metadata and controls
55 lines (46 loc) · 1.86 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
49
50
51
52
53
54
55
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
namespace DotNetCore.CAP.Internal;
/// <inheritdoc />
/// <summary>
/// An abstract attribute that for kafka attribute or rabbit mq attribute
/// </summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = true)]
public abstract class TopicAttribute : Attribute
{
protected TopicAttribute(string name, bool isPartial = false)
{
Name = name;
IsPartial = isPartial;
}
/// <summary>
/// Topic or exchange route key name.
/// </summary>
public string Name { get; }
/// <summary>
/// Defines whether this attribute defines a topic subscription partial.
/// The defined topic will be combined with a topic subscription defined on class level,
/// which results for example in subscription on "class.method".
/// </summary>
public bool IsPartial { get; }
/// <summary>
/// Default group name is CapOptions setting.(Assembly name)
/// Kafka --> groups.id
/// RabbitMQ --> queue.name
/// </summary>
public string Group { get; set; } = default!;
/// <summary>
/// Limit the number of messages consumed concurrently.
/// If you set this value but don't specify the Group, we will automatically create a Group using the Name.
/// </summary>
public byte GroupConcurrent { get; set; }
/// <summary>
/// Sent or received succeed message after time span of due, then the message will be deleted at due time.
/// </summary>
public int SucceedMessageExpiredAfter { get; set; }
/// <summary>
/// Sent or received failed message after time span of due, then the message will be deleted at due time.
/// </summary>
public int FailedMessageExpiredAfter { get; set; }
}