예제 #1
0
파일: RpcServer.cs 프로젝트: Aqmic/Dcp.Lib
        public static RpcServer GetDefault(string mqAddress, IList <string> routeKeyList, string applicationId)
        {
            DistributedMQConfig distributedMQConfig = new DistributedMQConfig
            {
                ServerAddress = mqAddress,
                Exchange      = "RPC_EXCHANGE",
                MsgSendType   = MessageSendType.Router,
                IsDurable     = false
            };
            RpcServer server = new RpcServer(distributedMQConfig, routeKeyList, applicationId);

            return(server);
        }
예제 #2
0
파일: RpcManager.cs 프로젝트: Aqmic/Dcp.Lib
        public RpcServer StartServer()
        {
            DistributedMQConfig distributedMQConfig = new DistributedMQConfig
            {
                ServerAddress = this.MqRpcConfig.MqAddress,
                Exchange      = this.MqRpcConfig.Exchange,
                ProducerID    = GetCurrentServerRpcName(),
                MsgSendType   = MessageSendType.Router,
                IsDurable     = false
            };
            var       routeKeyList = IocUnity.Get <DefaultRegisterService>().GetRouteKeyList();
            RpcServer server       = new RpcServer(distributedMQConfig, routeKeyList, null);

            server.ReciveMsgedEvent -= new ReciveMQMessageHandler(RpcServer_ReciveMsgedEvent);
            server.ReciveMsgedEvent += new ReciveMQMessageHandler(RpcServer_ReciveMsgedEvent);
            CurrentRpcServer         = server;
            return(server);
        }