response = orderMessageService.apply(mdpRequest[A1] ); |
public interface OrderMessageService[A2] { public MdpResponse apply(OssMdpRequest request); } |
public MdpResponse [A3] apply(OssMdpRequest request) { LOG.info("收到消息请求:,orderId="+request.getOrderId()+",productCode="+request.getProductCode());
|
下面来看xml文件是如何把这3个包给联系起来的
<bean id="publishService[A4] " class="com.bill99.seashell.boss.appcontroller.crm.PublishService[A5] " scope="prototype"> <property name="orderMessageService"> <ref bean="orderMessageService" /> </property> |
<mdp:reference id="orderMessageService[A6] " interface="com.bill99.boss.mdp.client.service.OrderMessageService"[A7] destination="notify.mdp.coe.dpm.boss.order.hqr1[A8] " concurrency="5" connection-factory="seashellConnectionFactory" timeout="60000"> </mdp:reference> |
<mdp:service id="orderMsgService[A9] " interface="com.bill99.boss.mdp.client.service.OrderMessageService" destination="notify.mdp.coe.dpm.boss.order.hqr1[A10] " ref="orderMessageService[A11] " concurrency="5" connection-factory="seashellConnectionFactory"> </mdp:service> |
<bean id="orderMessageService[A12] " class="com.bill99.boss.domain.mdp.OrderMessageServiceImpl"> <property name="ruleEngine"> <ref bean="ossRuleEngine" /> </property> <property name="publishService"> <ref bean="publishService" /> </property> <property name="orderParamConfigService"> <ref bean="orderParamConfigService" /> </property> </bean> |
说明,以上最重要的就是第三第四步
[A1]Intra里面的代码
[A2]Client里面的代码
[A3]Order里面的代码
[A4]Intra里面的xml
[A5]第一步就是在publishservice里面把orderMessageService给注入了进来,下一步就是去找orderMessageService
[A6]Intra的xml
第二步就是找到了orderMessageService
[A7]注意这个接口就说明是在client包里面的。
[A8]第三步:桥梁作用,消息队列,一定要和order里面的一样,并且是唯一的。
[A9]Order包的
[A10]第四步,桥梁作用,消息队列,一定要和intra里面的是一样的,并且要唯一。
[A11]第五步,根据它去找到下面的OrderMessageServiceImpl类。
[A12]Order里面的,根据它找到OrderMessageServiceImpl类