[Option('h', "host", HelpText = "Hostname of the RabbitMQ server.", Default = "localhost")]
publicstringHost{get;set;}
[Option("port", HelpText = "AMQP port of the RabbitMQ server.", Default = 5672)]
publicintPort{get;set;}
[Option('v', "virtualhost", HelpText = "Virtual host used for the RabbitMQ connection.", Default = "/")]
publicstringVirtualHost{get;set;}
[Option('u', "username", HelpText = "Username used to connect to the RabbitMQ server.", Default = "guest")]
publicstringUsername{get;set;}
[Option('p', "password", HelpText = "Password used to connect to the RabbitMQ server.", Default = "guest")]
publicstringPassword{get;set;}
}
publicenumSerializationMethod
{
SingleFileJSON,
EasyNetQHosepipe
}
publicclassMessageSerializerOptions:CommonOptions
{
[Option('s', "serialization", HelpText = "The method used to serialize the message for import or export. Valid options: SingleFileJSON, EasyNetQHosepipe.", Default = SerializationMethod.SingleFileJSON)]
[Verb("export", HelpText = "Fetch messages from a queue and write it to disk.")]
publicclassExportOptions:MessageSerializerOptions
{
[Option('q', "queue", Required = true, HelpText = "The queue to read the messages from.")]
publicstringQueueName{get;set;}
[Option('o', "output", Required = true, HelpText = "Path or filename (depending on the chosen serialization method) where the messages will be output to.")]
publicstringOutputPath{get;set;}
[Option('r', "remove", HelpText = "If specified messages are acknowledged and removed from the queue. If not messages are kept.")]
publicboolRemoveMessages{get;set;}
[Option('n', "maxcount", HelpText = "(Default: all) Maximum number of messages to retrieve from the queue.")]
publicint?MaxCount{get;set;}
}
[Verb("import", HelpText = "Read messages from disk as previously exported and publish them to a queue.")]
[Option('i', "input", Group = "Input", HelpText = "Path or filename (depending on the chosen serialization method) where the messages will be read from.")]
publicstringInputFile{get;set;}
[Option('m', "message", Group = "Input", HelpText = "Single message to be sent, in the same format as used for SingleFileJSON. Serialization argument has no effect when using this input.")]
[Option('c', "pipe", Group = "Input", HelpText = "Messages are read from the standard input pipe, in the same format as used for SingleFileJSON. Serialization argument has no effect when using this input.")]
[Option('e', "exchange", HelpText = "If specified publishes to the originating exchange using the original routing key. By default these are ignored and the message is published directly to the originating queue.")]
[Verb("shovel", HelpText = "Reads messages from a queue and publishes them to another queue, optionally to another RabbitMQ server.")]
publicclassShovelOptions:CommonOptions
{
[Option('q', "queue", Required = true, HelpText = "The queue to read the messages from.")]
publicstringQueueName{get;set;}
[Option('t', "targetqueue", HelpText = "The target queue to publish the messages to. Defaults to the source queue if a different target host, port or virtualhost is specified. Otherwise it must be different from the source queue.")]
publicstringTargetQueueName{get;set;}
[Option('r', "remove", HelpText = "If specified messages are acknowledged and removed from the source queue. If not messages are kept.")]
publicboolRemoveMessages{get;set;}
[Option('n', "maxcount", HelpText = "(Default: all) Maximum number of messages to retrieve from the queue.")]
publicint?MaxCount{get;set;}
[Option("targethost", HelpText = "Hostname of the target RabbitMQ server. Defaults to the source host. Note that you may still specify a different targetusername for example.")]
publicstringTargetHost{get;set;}
[Option("targetport", HelpText = "AMQP port of the target RabbitMQ server. Defaults to the source port.")]
publicint?TargetPort{get;set;}
[Option("targetvirtualhost", HelpText = "Virtual host used for the target RabbitMQ connection. Defaults to the source virtualhost.")]
publicstringTargetVirtualHost{get;set;}
[Option("targetusername", HelpText = "Username used to connect to the target RabbitMQ server. Defaults to the source username.")]
publicstringTargetUsername{get;set;}
[Option("targetpassword", HelpText = "Password used to connect to the target RabbitMQ server. Defaults to the source password.")]
[Verb("purge", HelpText = "Removes all messages from a queue destructively.")]
publicclassPurgeOptions:CommonOptions
{
[Option('q', "queue", Required = true, HelpText = "The queue to purge.")]
publicstringQueueName{get;set;}
[Option("confirm", HelpText = "Confirms the purging of the specified queue. If not provided, an interactive prompt will ask for confirmation.", Default = false)]
[Option('q', "queue", Required = true, HelpText = "The name of the queue to declare.")]
publicstringQueueName{get;set;}
[Option('b', "bindings", Required = false, HelpText = "One or more bindings to add to the queue. Format: <exchange>:<routingKey>")]
publicIEnumerable<string>Bindings{get;set;}
}
[Verb("removequeue", HelpText = "Removes a durable queue.")]
publicclassRemoveQueueOptions:CommonOptions
{
[Option('q', "queue", Required = true, HelpText = "The name of the queue to declare.")]
publicstringQueueName{get;set;}
[Option("confirm", HelpText = "Confirms the removal of the specified queue. If not provided, an interactive prompt will ask for confirmation.", Default = false)]
publicboolConfirm{get;set;}
[Option("confirmpurge", HelpText = "Confirms the removal of the specified queue even if there still are messages in the queue. If not provided, an interactive prompt will ask for confirmation.", Default = false)]