|
@@ -11,6 +11,7 @@ import org.springframework.amqp.core.Message;
|
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
|
@@ -24,6 +25,7 @@ public class ChargeMqListener {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private OrderService orderService;
|
|
private OrderService orderService;
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
@RabbitListener(queues = ChargeProduceConfig.NAME, containerFactory = ChargeProduceConfig.LISTENER)
|
|
@RabbitListener(queues = ChargeProduceConfig.NAME, containerFactory = ChargeProduceConfig.LISTENER)
|
|
public void dealDeclareMessage(Message message) {
|
|
public void dealDeclareMessage(Message message) {
|
|
try {
|
|
try {
|