Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.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
Java spring integration inboundChannelAdapter一次生成多条消息?_Java_Spring_Spring Integration - Fatal编程技术网

Java spring integration inboundChannelAdapter一次生成多条消息?

Java spring integration inboundChannelAdapter一次生成多条消息?,java,spring,spring-integration,Java,Spring,Spring Integration,在本例中,我尝试定义一个InboundChannelAdapter来从队列API azure读取消息。本机方法如下所示: @Bean @InboundChannelAdapter(value = "myChannelExample", poller = @Poller(fixedDelay = "1000", maxMessagesPerPoll = "1

在本例中,我尝试定义一个InboundChannelAdapter来从队列API azure读取消息。本机方法如下所示:

  @Bean
  @InboundChannelAdapter(value = "myChannelExample",
                         poller = @Poller(fixedDelay = "1000",
                                          maxMessagesPerPoll = "1"))
  public MessageSource<QueueMessage> queueReadingMessageSource() {
      return wrapMessage(queueClient.readMessage())
  }

这正如预期的那样工作-但我想知道是否有一种更有效的方法来定义一个适配器,该适配器能够从消息源一次读取多条maxMessagesPerPoll>1消息?是否有允许返回消息列表的messageSource接口?

您只需返回带有列表负载的消息并在下游添加拆分器即可