|
|
@@ -42,11 +42,27 @@ public class RabbitReceiveService extends BaseRabbitReceiveService {
|
|
|
case "trade":
|
|
|
processMessageForReceivable(messageInfo.getBizId(), messageInfo.getBizType());
|
|
|
default:
|
|
|
- break;
|
|
|
+ throw new Exception("无法处理的消息");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void processMessageForReceivable(String bizId, String bizType) {
|
|
|
- LOGGER.info("消费消息,bizId:{}, bizType:{}", bizId, bizType);
|
|
|
+ private void processMessageForReceivable(String bizId, String bizType) throws Exception {
|
|
|
+ /* 根据不同的bizType,方案:1.调用不同的方法. 2.处理自己需要变量操作,调用同一个方法 */
|
|
|
+ switch (bizType){
|
|
|
+ case "PURCHASE":
|
|
|
+ /* 执行必要的操作 */
|
|
|
+ execute();
|
|
|
+ break;
|
|
|
+ case "PURCHASECHANGE":
|
|
|
+ /* 执行必要的操作 */
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ private void execute() throws Exception {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
}
|