예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="messageReplier"></param>
        /// <param name="deployIndependently">是否独立部署。是:将在内部创建RPC
        /// 否:需要注册本服务接口【ITcpMessageCentralizedService】到外部RPC</param>
        public MessageBusService(IMessageReplier messageReplier, bool deployIndependently = true)
        {
            MessagePipe <IMessage, IMessage> usePipe = new ConsumerProducePipe {
                MessageMails = this._concurrentDictionary
            };

            if (deployIndependently)
            {
                var actuator = new Actuator();
                actuator.Container.Register(Component.For <ITcpMessageCentralizedService>()
                                            .Instance(this));
                var callProducePipe = new CallProducePipe {
                    Actuator = actuator
                };
                usePipe = usePipe.Append(callProducePipe);
            }
            if (messageReplier.ProducePipe == null)
            {
                messageReplier.ProducePipe = usePipe;
            }
            else
            {
                messageReplier.ProducePipe.Append(usePipe);
            }
        }
예제 #2
0
        public ProcedureCallService(IMessageReplier netMessageListener)
        {
            var callProducePipeline = new CallProducePipe {
                Actuator = _actuator
            };

            if (netMessageListener.ProducePipe == null)
            {
                netMessageListener.ProducePipe = callProducePipeline;
            }
            else
            {
                netMessageListener.ProducePipe.Append(callProducePipeline);
            }
        }