1
0
mirror of synced 2024-11-16 14:53:50 +00:00
Tapeti/Tapeti.Annotations/DynamicQueueAttribute.cs
2019-03-19 11:47:52 +01:00

26 lines
854 B
C#

using System;
namespace Tapeti.Annotations
{
/// <inheritdoc />
/// <summary>
/// Creates a non-durable auto-delete queue to receive messages. Can be used
/// on an entire MessageController class or on individual methods.
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
public class DynamicQueueAttribute : Attribute
{
public string Prefix { get; set; }
/// <inheritdoc />
/// <param name="prefix">An optional prefix. If specified, Tapeti will compose the queue name using the
/// prefix and a unique ID. If not specified, an empty queue name will be passed
/// to RabbitMQ thus letting it create a unique queue name.</param>
public DynamicQueueAttribute(string prefix = null)
{
Prefix = prefix;
}
}
}