A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

六、 重构客户注册功能,发短信功能分离
重构目标: 在 bos_fore 项目 CustomerAction 作为短信消息生产者,将消息发给 ActiveMQ, 建立单独 SMS 项目,作为短信消息消费者,从 ActiveMQ 获取发短信消息,调用第三方接口完成短信发送 。
1 bos_fore 项目客户注册,作为短信消息生产者配置 applicationContext.xml  
配置 applicationContext-mq.xml  
将 jmsTemplate 注入 CustomerAction  
错误:
Caused by:  
java.lang.ClassNotFoundException:
org.apache.xbean.spring.context.v2.XBeanNamespaceHandler
错误:
Caused         by:         java.lang.IllegalStateException:         Cannot         convert         value         of         type [org.springframework.jms.connection.CachingConnectionFactory]         to         required         type [org.springframework.data.redis.connection.RedisConnectionFactory]         for         property 'connectionFactory': no matching editors or conversion strategy found
2 创建 bos_sms 短信平台,消费 MQ 发短信消息  
1、 建立一个新的工程  
配置端口 9004
2、 配置 web.xml spring 监听器  
3、 配置 applicationContext.xml  
4、 在 cn.itcast.bos.mq 编写 SmsConsumer 类


0 个回复

您需要登录后才可以回帖 登录 | 加入黑马