测试RabbitMQ

This commit is contained in:
Guoqs
2024-11-05 16:56:43 +08:00
parent 45a2920981
commit 1c3e228911
4 changed files with 29 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ import com.jsowell.pile.vo.web.PileStationVO;
import com.jsowell.service.OrderService;
import com.jsowell.service.TempService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -65,6 +66,9 @@ public class TempController extends BaseController {
@Autowired
private OrderService orderService;
@Autowired
private RabbitTemplate rabbitTemplate;
@Autowired
private SettleOrderReportService settleOrderReportService;
@@ -583,4 +587,13 @@ public class TempController extends BaseController {
}
return response;
}
/**
* 测试RabbitMQ
*/
@PostMapping("/testRabbitMQ")
public RestApiResponse<?> testRabbitMQ(@RequestBody TestRabbitMQDTO dto) {
rabbitTemplate.convertAndSend(dto.getExchange(), dto.getRoutingKey(), dto.getData());
return new RestApiResponse<>();
}
}