Exemplo n.º 1
0
        protected virtual void Init()
        {
            var fabric    = new ManualFabricBridge();
            var bridgeOut = fabric[FabricMode.Queue];
            var bridgein  = fabric[FabricMode.Broadcast];

            mWebApi = new UnityWebApiMicroservicePipeline("Web")
                      .CallOut(WebApiConfigure)
                      .AddChannelOutgoing("Request", "This is the outgoing request channel")
                      .AttachSender(mBridgeRequest.GetSender())
                      .Revert()
                      .AddChannelIncoming("Response", "This is the response channel back from the Service")
                      .AttachListener(mBridgeResponse.GetListener())
                      .Revert();


            mService1 = new MicroservicePipeline("Service")
                        .CallOut(ServiceConfigure)
                        .AddChannelIncoming("Request", "This is the incoming request channel from the API")
                        .AttachListener(mBridgeRequest.GetListener())
                        .Revert()
                        .AddChannelOutgoing("Response", "This is the outgoing request channel")
                        .AttachSender(mBridgeResponse.GetSender())
                        .Revert()
            ;


            mService1.Start();
            mWebApi.Start();
        }
Exemplo n.º 2
0
            public void Create(string id
                               , ICommunicationBridge bridgeOut, ICommunicationBridge bridgeIn, ICommunicationBridge bridgeMaster
                               , TestMasterJobCommand masterjob
                               , out PersistenceClient <Guid, BridgeMe> init, out DebugMemoryDataCollector memcollector)
            {
                var pipeline = new MicroservicePipeline(id)
                               .AdjustPolicyTaskManagerForDebug()
                               .AdjustPolicyCommunication((p, c) => p.BoundaryLoggingActiveDefault = true)
                               .AddDebugMemoryDataCollector(out memcollector)
                               .AddChannelIncoming("local", internalOnly: true)
                               .AttachCommand(masterjob)
                               .Revert()
                               .AddChannelIncoming("cresponse")
                               .AttachListener(bridgeIn.GetListener())
                               .Revert()
                               .AddChannelOutgoing("crequest")
                               .AttachSender(bridgeOut.GetSender())
                               .AttachPersistenceClient("cresponse", out init)
                               .Revert()
                               .AddChannelBroadcast("negotiate")
                               .AttachListener(bridgeMaster.GetListener())
                               .AttachSender(bridgeMaster.GetSender())
                               .AssignMasterJob(masterjob)
                               .Revert()
                ;

                Add(id, pipeline, masterjob);
            }
Exemplo n.º 3
0
        protected virtual void Init()
        {
            var fabric = new ManualFabricBridge();

            mBridgeRequest  = new ManualCommunicationBridgeAgent(fabric, CommunicationBridgeMode.RoundRobin);
            mBridgeResponse = new ManualCommunicationBridgeAgent(fabric, CommunicationBridgeMode.Broadcast);

            mWebApi = new UnityWebApiMicroservicePipeline("Web")
                      .CallOut(WebApiConfigure)
                      .AddChannelOutgoing("Request", "This is the outgoing request channel")
                      .AttachSender(mBridgeRequest.GetSender())
                      .Revert()
                      .AddChannelIncoming("Response", "This is the response channel back from the Service")
                      .AttachListener(mBridgeResponse.GetListener())
                      .Revert();


            mService1 = new MicroservicePipeline("Service")
                        .CallOut(ServiceConfigure)
                        .AddChannelIncoming("Request", "This is the incoming request channel from the API")
                        .AttachListener(mBridgeRequest.GetListener())
                        .Revert()
                        .AddChannelOutgoing("Response", "This is the outgoing request channel")
                        .AttachSender(mBridgeResponse.GetSender())
                        .Revert()
            ;


            mService1.Start();
            mWebApi.Start();
        }