public async Task Start() { try { var builder = new ContainerBuilder(); var endpointConfiguration = NSBEndpointConfiguration.ConfigureEndpoint(builder, EndpointName); endpointConfiguration.DefineCriticalErrorAction(OnCriticalError); endpoint = await Endpoint.Start(endpointConfiguration); //schedule send job JobManager.AddJob( new SendMessageJob(endpoint), schedule => { schedule .ToRunNow() .AndEvery(3).Seconds(); }); } catch (Exception ex) { FailFast("Failed to start.", ex); } }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { var endpointConfiguration = NSBEndpointConfiguration.ConfigureEndpoint(EndpointName); endpointConfiguration.EnableCallbacks(); endpointConfiguration.MakeInstanceUniquelyAddressable("InstanceID"); //TODO: needs to be dynamic for scale up...used for callbacks services.AddControllers(); services.AddNServiceBus(endpointConfiguration); }
public async Task Start() { try { var builder = new ContainerBuilder(); var endpointConfiguration = NSBEndpointConfiguration.ConfigureEndpoint(builder, EndpointName); endpointConfiguration.DefineCriticalErrorAction(OnCriticalError); endpoint = await Endpoint.Start(endpointConfiguration); } catch (Exception ex) { FailFast("Failed to start.", ex); } }