public async Task Execute(IJobExecutionContext context) { try { var endpointInstance = context.EndpointInstance(); var message = new MyMessage(); await endpointInstance.Send("Samples.QuartzScheduler.Receiver", message) .ConfigureAwait(false); } catch (Exception exception) { log.Fatal("Execution Failed", exception); // TODO: handle exception and dont throw. // consider implementing a circuit breaker throw; } }
public Task Execute(IJobExecutionContext context) { var endpointInstance = context.EndpointInstance(); return(endpointInstance.Send("Samples.QuartzScheduler.Receiver", new MyMessage())); }