Ejemplo 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();
        }
Ejemplo n.º 2
0
        public void TestMethod2()
        {
            try
            {
                var pipe = new UnityWebApiMicroservicePipeline();

                pipe
                .AddChannelIncoming("freddyin", autosetPartition01: false)
                .AttachPriorityPartition(0, 1, 2)
                .AttachCommandUnity(typeof(IHello), new CommandHello(), responseChannel: new Channel("freda", ChannelDirection.Incoming))
                .Revert()
                .AddChannelOutgoing("freddyout", autosetPartition01: false)
                .AttachPriorityPartition(1, 2)
                ;

                var result = pipe.Unity.Resolve(typeof(IHello));
                Assert.IsNotNull(result);
                Assert.IsTrue(((ICommand)result).ResponseChannelId == "freda");

                pipe.Start();

                pipe.Stop();
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        protected virtual void Init()
        {
            mBridgeRequest  = new CommunicationBridge(CommunicationBridgeMode.RoundRobin);
            mBridgeResponse = new CommunicationBridge(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();
        }
Ejemplo n.º 4
0
        public void PipelineUnityWebApi()
        {
            var pipe = new UnityWebApiMicroservicePipeline();

            //pipe.AddSharedService(
            pipe.Start();

            pipe.Stop();
        }
Ejemplo n.º 5
0
        public void PipelineUnityWebApi()
        {
            var pipe = new UnityWebApiMicroservicePipeline();

            pipe
            .AddChannelIncoming("freddyin", autosetPartition01: false)
            .AttachPriorityPartition(0, 1, 2)
            .Revert()
            .AddChannelOutgoing("freddyout", autosetPartition01: false)
            .AttachPriorityPartition(1, 2)
            ;

            pipe.Start();

            pipe.Stop();
        }