2016-12-05 07:00:09 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace Tapeti.Annotations
|
|
|
|
|
{
|
2019-03-19 10:47:52 +00:00
|
|
|
|
/// <inheritdoc />
|
2016-12-05 07:00:09 +00: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)]
|
|
|
|
|
public class DynamicQueueAttribute : Attribute
|
|
|
|
|
{
|
2018-08-31 17:17:56 +00:00
|
|
|
|
public string Prefix { get; set; }
|
|
|
|
|
|
|
|
|
|
|
2019-03-19 10:47:52 +00: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 17:17:56 +00:00
|
|
|
|
public DynamicQueueAttribute(string prefix = null)
|
|
|
|
|
{
|
|
|
|
|
Prefix = prefix;
|
|
|
|
|
}
|
2016-12-05 07:00:09 +00:00
|
|
|
|
}
|
|
|
|
|
}
|