2016-12-05 08:00:09 +01:00
|
|
|
|
using System;
|
2019-05-20 15:24:12 +02:00
|
|
|
|
using JetBrains.Annotations;
|
2016-12-05 08:00:09 +01:00
|
|
|
|
|
|
|
|
|
namespace Tapeti.Annotations
|
|
|
|
|
{
|
2019-03-19 11:47:52 +01:00
|
|
|
|
/// <inheritdoc />
|
2016-12-05 08:00:09 +01:00
|
|
|
|
/// <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)]
|
2019-05-20 15:24:12 +02:00
|
|
|
|
[MeansImplicitUse]
|
2016-12-05 08:00:09 +01:00
|
|
|
|
public class DynamicQueueAttribute : Attribute
|
|
|
|
|
{
|
2019-05-27 11:48:10 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 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.
|
|
|
|
|
/// </summary>
|
2018-08-31 19:17:56 +02:00
|
|
|
|
public string Prefix { get; set; }
|
|
|
|
|
|
|
|
|
|
|
2019-03-19 11:47:52 +01:00
|
|
|
|
/// <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>
|
2018-08-31 19:17:56 +02:00
|
|
|
|
public DynamicQueueAttribute(string prefix = null)
|
|
|
|
|
{
|
|
|
|
|
Prefix = prefix;
|
|
|
|
|
}
|
2016-12-05 08:00:09 +01:00
|
|
|
|
}
|
|
|
|
|
}
|