pengyu0929 edited a comment on issue #473: 使用Feign调用失败,显示global transaction has already aborted URL: https://github.com/apache/servicecomb-pack/issues/473#issuecomment-496763298 我刚测试了下不可以的,你能帮忙看一下哪里出问题了吗? Booking服务: ` @SagaStart @Override @Transactional public String booking(Booking booking) { System.out.println(booking.getName() + " : 开始预定。。。"); carFeignClient.bookingCar(booking.getName(), booking.getCars()); postCarBooking(); bookingMapper.insert(booking); hotelFeignClient.bookingHotel(booking.getName(), booking.getRooms()); int i =1/0; return booking.getName() + " booking " + booking.getRooms() + " rooms and " + booking.getCars() + " cars OK"; }` Car服务: ` @Compensable(compensationMethod = "cancel", retries = 3, retryDelayInMilliseconds = 2000) @Override @Transactional public CarBooking order(CarBooking booking) { System.out.println(booking.getName() + " : 开始预定出租车。。。。"); int insert = carBookingMapper.insert(booking); System.out.println(booking.getName() + " : 预定出租车成功 , 预定数量 : " + insert); return booking; }` Hotel服务: ` @Compensable(compensationMethod = "cancel", retries = 3, retryDelayInMilliseconds = 2000) @Override @Transactional public HotelBooking order(HotelBooking booking) { System.out.println(booking.getName() + " : 开始预定房间。。。"); int insert = hotelBookingMapper.insert(booking); System.out.println(booking.getName() + " : 预定房间成功,数量 : " + insert); return booking; }` Car和Hotel都有对应的补偿方法,无返回值,public修饰符,参数和对应方法一致。
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
