public void AddOrchestration(Orchestration orchestration) { if (Orchestrations == null) { Orchestrations = new List <Orchestration>(); } Orchestrations.Add(orchestration); }
protected override void ApplyEnvironmentOverrides(string environment) { base.ApplyEnvironmentOverrides(environment); Orchestrations.Add( new Orchestrations.Direct.ProcessOrchestrationBinding( o => { o.Host = CommonSettings.ReceiveHost; }), new Orchestrations.Dummy.ProcessOrchestrationBinding( o => { o.ReceivePort = ReceivePorts.Find <BatchReceivePort>(); o.RequestResponsePort = _twoWayReceivePort; o.SendPort = SendPorts.Find <BatchAddPartSendPort>(); o.SolicitResponsePort = _twoWaySendPort; o.Host = CommonSettings.ReceiveHost; o.State = ServiceState.Unenlisted; })); }
public SampleApplication() { Name = ApplicationName.Is("Detailed.SampleApplication"); ReceivePorts.Add( CustomerOneWayReceivePort = ReceivePort( p => { p.Name = ReceivePortName.Offwards(Party.Customer); p.ReceiveLocations .Add( ReceiveLocation( l => { l.Name = ReceiveLocationName.About(MessageName.Invoice).FormattedAs.Xml; l.Enabled = false; l.ReceivePipeline = new ReceivePipeline <XmlReceive>(); l.Transport.Adapter = new FileAdapter.Inbound(a => { a.ReceiveFolder = @"c:\files\drops"; }); l.Transport.Host = Host.RECEIVING_HOST; }), ReceiveLocation( l => { l.Name = ReceiveLocationName.About(MessageName.CreditNote).FormattedAs.Edi; l.Enabled = false; l.ReceivePipeline = new ReceivePipeline <XmlReceive>(); l.Transport.Adapter = new FileAdapter.Inbound(a => { a.ReceiveFolder = @"c:\files\drops"; }); l.Transport.Host = Host.RECEIVING_HOST; }) ); }), CustomerTwoWayReceivePort = ReceivePort( p => { p.Name = ReceivePortName.Offwards(Party.Customer); p.Description = "Receives ledgers from customers"; p.ReceiveLocations.Add( ReceiveLocation( l => { l.Name = ReceiveLocationName.About(MessageName.Statement).FormattedAs.Csv; l.Enabled = true; l.ReceivePipeline = new ReceivePipeline <PassThruReceive>(pl => { pl.Decoder <FailedMessageRoutingEnablerComponent>(c => { c.Enabled = false; }); }); l.SendPipeline = new SendPipeline <PassThruTransmit>(pl => { pl.PreAssembler <FailedMessageRoutingEnablerComponent>(c => { c.Enabled = false; }); }); l.Transport.Adapter = new FileAdapter.Inbound(a => { a.ReceiveFolder = @"c:\files\drops"; }); l.Transport.Host = Host.RECEIVING_HOST; })); }), ReceivePort( p => { p.Name = ReceivePortName.Offwards(Party.Bank); p.Description = "Receives financial movements from bank"; p.ReceiveLocations.Add( ReceiveLocation( l => { l.Name = ReceiveLocationName.About(MessageName.Statement).FormattedAs.Xml; l.Enabled = true; l.ReceivePipeline = new ReceivePipeline <MicroPipelines.XmlReceive>( pl => { pl.Decoder <MicroPipelineComponent>( c => { c.Enabled = false; c.Components = new IMicroPipelineComponent[] { new FailedMessageRoutingEnabler { EnableFailedMessageRouting = true, SuppressRoutingFailureReport = false }, new ActivityTracker { TrackingModes = ActivityTrackingModes.Claim, TrackingContextCacheDuration = TimeSpan.FromSeconds(120) } }; }); }); l.Transport.Adapter = new WcfSqlAdapter.Inbound( a => { a.Address = new SqlAdapterConnectionUri { InboundId = "FinancialMovements", InitialCatalog = "BankDb", Server = "localhost" }; a.InboundOperationType = InboundOperation.XmlPolling; a.PolledDataAvailableStatement = "select count(1) from data"; a.PollingStatement = "select * from data for XML"; a.PollingInterval = TimeSpan.FromHours(2); a.PollWhileDataFound = true; }); l.Transport.Host = Host.RECEIVING_HOST; })); }), TaxAgencyOneWayReceivePort = new TaxAgencyReceivePort()); SendPorts.Add( BankOneWaySendPort = new BankSendPort(), CustomerTwoWaySendPort = SendPort( p => { p.Name = SendPortName.Towards(Party.Customer).About(MessageName.Statement).FormattedAs.Csv; p.SendPipeline = new SendPipeline <PassThruTransmit>(pl => { pl.PreAssembler <FailedMessageRoutingEnablerComponent>(c => { c.Enabled = false; }); }); p.ReceivePipeline = new ReceivePipeline <PassThruReceive>(pl => { pl.Decoder <FailedMessageRoutingEnablerComponent>(c => { c.Enabled = false; }); }); p.Transport.Adapter = new FileAdapter.Outbound(a => { a.DestinationFolder = @"c:\files\drops"; }); p.Transport.RetryPolicy = RetryPolicy.LongRunning; p.Transport.Host = Host.SENDING_HOST; })); Orchestrations.Add( new ProcessOrchestrationBinding( o => { o.ReceivePort = CustomerOneWayReceivePort; o.RequestResponsePort = CustomerTwoWayReceivePort; o.SendPort = BankOneWaySendPort; o.SolicitResponsePort = CustomerTwoWaySendPort; o.Host = Host.PROCESSING_HOST; })); }