[BusNamespace(Directory = "John", Subdirectory = "Doe")]
public class MyEvent
{
public string Cat { get; set; }
public DateTime Dog { get; set; }
public Guid Tiger { get; set; }
}
public class MyEventHandler : IEventHandler<MyEvent>
{
public IMicroserviceBus Bus { get; set; }
public ITraceScope TraceScope { get; set; }
public async Task HandleAsync(MyEvent message)
{
}
}
IMicroserviceLifetime ml = new RabbitMQDriver("Host=x;VHost=y;Port=z;User=k;Password=w;AppId=m");
ml.Subscribe<MyEventHandler, MyEvent>(null, null, null, null);
[BusNamespace(Directory = "John", Subdirectory = "Doe")]
public class MyRequest
{
public int Lion { get; set; }
public DateTime Crocodile { get; set; }
public Guid Horse { get; set; }
}
public class MyRequestResponder : IResponder<MyRequest>
{
public IMicroserviceBus Bus { get; set; }
public ITraceScope TraceScope { get; set; }
public async Task<object> RespondAsync(MyRequest message)
{
}
}
ml.Subscribe<MyRequestResponder, MyRequest>(null);
ml.Startup();
IGatewayBus gbus = new RabbitMQDriver("Host=x;VHost=y;Port=z;User=k;Password=w;AppId=g");
MyResponse response = await gbus.RequestAsync<MyResponse>(new MyRequest
{
Lion = 5,
Crocodile = DateTime.UtcNow,
Horse = Guid.NewGuid()
});
ISchedulerBus sbus = new RabbitMQDriver("Host=x;VHost=y;Port=z;User=k;Password=w;AppId=s");
sbus.Schedule("* * * * *", () =>
{
return message;
},
async (Exception e) =>
{
});