...
|
...
|
@@ -45,9 +45,9 @@ public class RabbitController { |
|
|
private AsyncTaskService asyncTaskService;
|
|
|
|
|
|
/**
|
|
|
* 消费消息,多个
|
|
|
* 消费消息,one
|
|
|
*
|
|
|
* @param receiver 接收者
|
|
|
* @param RUSR 接收者
|
|
|
* @param SERV 服务器
|
|
|
* @param VSHT 虚拟主机
|
|
|
* @param RCVR 队列
|
...
|
...
|
@@ -55,14 +55,14 @@ public class RabbitController { |
|
|
*/
|
|
|
@GetMapping("/consumer_one")
|
|
|
public ResultJson consumerOne(
|
|
|
@RequestParam(value = "receiver") String receiver,
|
|
|
@RequestParam(value = "RUSR") String RUSR,
|
|
|
@RequestParam(value = "SERV") String SERV,
|
|
|
@RequestParam(value = "VSHT") String VSHT,
|
|
|
@RequestParam(value = "RCVR") String RCVR)
|
|
|
{
|
|
|
try {
|
|
|
XmlData xmlData = XmlData.builder()
|
|
|
.receiver(receiver)
|
|
|
.receiver(RUSR)
|
|
|
.serverName(SERV)
|
|
|
.virtualHostName(VSHT)
|
|
|
.queueName(RCVR)
|
...
|
...
|
@@ -79,26 +79,26 @@ public class RabbitController { |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 消费消息,多个
|
|
|
* 消费消息,more
|
|
|
*
|
|
|
* @param receiver 接收者
|
|
|
* @param RUSR 接收者
|
|
|
* @param SERV 服务器
|
|
|
* @param VSHT 虚拟主机
|
|
|
* @param RCVR 队列
|
|
|
* @param count 消息数量
|
|
|
* @param CUNT 消息数量
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/consumer_more")
|
|
|
public ResultJson consumerMore(
|
|
|
@RequestParam(value = "receiver") String receiver,
|
|
|
@RequestParam(value = "RUSR") String RUSR,
|
|
|
@RequestParam(value = "SERV") String SERV,
|
|
|
@RequestParam(value = "VSHT") String VSHT,
|
|
|
@RequestParam(value = "RCVR") String RCVR,
|
|
|
@RequestParam(value = "count", required = false) Integer count)
|
|
|
@RequestParam(value = "CUNT", required = false) Integer CUNT)
|
|
|
{
|
|
|
try {
|
|
|
XmlData xmlData = XmlData.builder()
|
|
|
.receiver(receiver)
|
|
|
.receiver(RUSR)
|
|
|
.serverName(SERV)
|
|
|
.virtualHostName(VSHT)
|
|
|
.queueName(RCVR)
|
...
|
...
|
@@ -107,10 +107,10 @@ public class RabbitController { |
|
|
if (!RESULT_SUCCESS.equals(validate.getCode())) {
|
|
|
return validate;
|
|
|
}
|
|
|
if (count == null || count < 1) {
|
|
|
count = 1;
|
|
|
if (CUNT == null || CUNT < 1) {
|
|
|
CUNT = 1;
|
|
|
}
|
|
|
ResultJson result = directUtils.directConsumerByPullMore(xmlData, count);
|
|
|
ResultJson result = directUtils.directConsumerByPullMore(xmlData, CUNT);
|
|
|
return result;
|
|
|
} catch (IOException | TimeoutException e) {
|
|
|
return ResultJson.error(CustomExceptionType.RECEIVE_SERVER_EXCEPTION);
|
...
|
...
|
|