Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Rabbitmq 如何使用Spring Cloud Stream Rabbit管理手动确认?_Rabbitmq_Spring Cloud_Spring Cloud Stream - Fatal编程技术网

Rabbitmq 如何使用Spring Cloud Stream Rabbit管理手动确认?

Rabbitmq 如何使用Spring Cloud Stream Rabbit管理手动确认?,rabbitmq,spring-cloud,spring-cloud-stream,Rabbitmq,Spring Cloud,Spring Cloud Stream,我尝试了几种使用RabbitMQ管理手动ack的方法,特别是基于,但不幸的是,它们都不起作用 在我的配置文件中,我已将确认模式设置为手动,如下所示: spring: cloud: stream: bindings: magento-consumer: binder: rabbit destination: toto durableSubscription: false cons

我尝试了几种使用RabbitMQ管理手动ack的方法,特别是基于,但不幸的是,它们都不起作用

在我的配置文件中,我已将确认模式设置为手动,如下所示:

spring:
  cloud:
    stream:
      bindings:
        magento-consumer:
          binder: rabbit
          destination: toto
          durableSubscription: false
          consumer:
            acknowledge-mode: MANUAL
然后,我有一个
receive
方法,该方法由
@StreamListener
注释,它接受4个参数:

@StreamListener(SinkInterface.NAME)
公共无效接收(
信息m,
@标头(name=Queue.TO_MAGENTO,required=false)布尔标头,
@标题(AmqpHeaders.CHANNEL)通道,
@标题(AmqpHeaders.DELIVERY_标记)长deliveryTag
) {
//做点什么
}
问题是
channel
参数始终为空,因此我无法检索
amqp\u channel

org.springframework.messaging.MessageHandlingException:方法参数类型[interface com.rabbitmq.client.channel]缺少标题“amqp_channel”

如何检索此通道参数? 我不明白为什么没有设置
amqp\u通道
,以及如何注入它


我遗漏了什么吗?

我发现属性名需要更正。设置acknowledgeMode的正确属性名为:
spring.cloud.stream.rabbit.bindings..consumer。确认模式
。你可以查看更多信息