Пример #1
0
        //public static void BuildProducer(String message, PFProdutTask task)
        //{
        //    PFMqConfig mqConfig = task.GetMqConfig(_mqConfig.TClone());
        //    PFMqType mqType = mqConfig.getMqType();
        //    switch (mqType)
        //    {
        //        //case RabbitMq:
        //        //	(new PFMq(mqConfig)).BuildMqProducer(message);
        //        //	break;
        //        //case RocketMq:
        //        //	(new PFMq(mqConfig)).BuildRocketMqProducer(message);
        //        //	break;
        //        //case AliMq:
        //        //	(new PFMq(mqConfig)).BuildAliMqProducer(message);
        //        //	break;
        //        case PFMqType.PFEmailMq:
        //            if (task is PFProdutTask)
        //            (new PFMq(mqConfig)).BuildPFEmailMqProducer(message);
        //            break;
        //        default:
        //            break;
        //    }
        //}
        //public static Task<PFEmail> BuildProducerAsync(String message, PFProdutTask task)
        //{
        //    PFMqConfig mqConfig = task.GetMqConfig(_mqConfig.TClone());
        //    PFMqType mqType = mqConfig.getMqType();
        //    switch (mqType)
        //    {
        //        //case RabbitMq:
        //        //	(new PFMq(mqConfig)).BuildMqProducer(message);
        //        //	break;
        //        //case RocketMq:
        //        //	(new PFMq(mqConfig)).BuildRocketMqProducer(message);
        //        //	break;
        //        //case AliMq:
        //        //	(new PFMq(mqConfig)).BuildAliMqProducer(message);
        //        //	break;
        //        case PFMqType.PFEmailMq:
        //            return (new PFMq(mqConfig)).BuildPFEmailMqProducerAsync(message);
        //            break;
        //        default:
        //            return (new PFMq(mqConfig)).BuildPFEmailMqProducerAsync(message);
        //            break;
        //    }
        //}

        public static Task <PFEmail> BuildProducer(String message, PFProdutTask task)
        {
            PFMqConfig mqConfig = task.GetMqConfig(_mqConfig.TClone());
            PFMqType   mqType   = mqConfig.getMqType();

            switch (mqType)
            {
            //case RabbitMq:
            //	(new PFMq(mqConfig)).BuildMqProducer(message);
            //	break;
            //case RocketMq:
            //	(new PFMq(mqConfig)).BuildRocketMqProducer(message);
            //	break;
            //case AliMq:
            //	(new PFMq(mqConfig)).BuildAliMqProducer(message);
            //	break;
            case PFMqType.PFEmailMq:
                if (task is PFProdutResponseTask)
                {
                    return((new PFMq(mqConfig)).BuildPFEmailMqProducerAsync(message));
                }
                (new PFMq(mqConfig)).BuildPFEmailMqProducer(message);
                break;

            default:
                break;
            }
            return(null);
        }
Пример #2
0
 //private static ApplicationContext _applicationContext;
 //@Autowired
 public PFMqHelper()//PFMqConfig mqConfig, ApplicationContext applicationContext)
 {
     //PFMqHelper._mqConfig = mqConfig;
     //PFMqHelper._applicationContext = applicationContext;
     //_mqType=PFMqType.valueOf(mqConfig.getMqType());
     //_mqType = mqConfig.getMqType();
     //PFMqHelper._mqConfig = new PFMqConfig();
     _mqType = _mqConfig.getMqType();
 }
Пример #3
0
        public static void BuildConsumer(PFConsumerResponseTask task)
        {
            PFMqConfig mqConfig = task.GetMqConfig(_mqConfig.TClone());
            PFMqType   mqType   = mqConfig.getMqType();

            switch (mqType)
            {
            //case PFMqType.RabbitMq:
            //	(new PFMq(mqConfig)).BuildRabbitMqConsumer(task);
            //	break;
            //case PFMqType.RocketMq:
            //	(new PFMq(mqConfig)).BuildRocketMqConsumer(task);
            //	break;
            //case PFMqType.AliMq:
            //	(new PFMq(mqConfig)).BuildAliMqConsumer(task);
            //	break;
            case PFMqType.PFEmailMq:
                (new PFMq(mqConfig)).BuildPFEmailMqConsumer(task);
                break;

            default:
                break;
            }
        }