示例#1
0
        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
        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);
        }