Beispiel #1
0
 public static ConnectionFactory CreateConnectionFactory(this MQParam param)
 {
     return(new ConnectionFactory
     {
         UserName = param.User,
         Password = param.Password,
         VirtualHost = param.VirtualHost,
         HostName = param.Host,
         Port = param.Port,
         AutomaticRecoveryEnabled = true,
         NetworkRecoveryInterval = TimeSpan.FromSeconds(5)
     });
 }
Beispiel #2
0
        public static ServiceProxy CreateServiceProxy(MQParam param, params object[] instances)
        {
            var factory = param.CreateConnectionFactory();

            return(new ServiceProxy(new Service(factory, param.RpcQueue, param.PrefetchCount), instances));
        }
Beispiel #3
0
        public static ClientProxy <TService> CreateClientProxy <TService>(MQParam param, bool isWrapFaultException = true, int timeoutInterval = 1200000, int hearbeatInterval = 10000)
        {
            ClientConnectionFactory factory = new ClientConnectionFactory(param);

            return(new ClientProxy <TService>(factory, isWrapFaultException, timeoutInterval, hearbeatInterval));
        }