public static void Execute(string topic, string[] queues, string[] retries) { try { Console.WriteLine("Executing..."); var args = new List <object>(); TopicOption.Validate(topic); QueuesOption.Validate(queues, args); RetriesOption.Validate(retries, args); Broker.Configuration .AddTopology <MultipleQueuesWithRetryTopologyFactory>( topic, args.ToArray()); var broker = Broker.GetInstance(); broker.EnsureTopology(topic); Console.WriteLine($"Topic {topic} with multiple queues created successfully!"); } catch (Exception e) { ExceptionHandler.Handle(e); } }
public static Command Setup() { var cmd = new Command(nameof(CreateSimpleQueue)); TopicOption.AddIn(cmd); RetriesOption.AddIn(cmd); cmd.Handler = CommandHandler.Create <string, string[]>(Execute); return(cmd); }