英文:
SCDF processor reads one message and outputs arrays of objects, but sink can handle single item
问题
我的处理器处理一个负载并生成一个列表
@StreamListener(Processor.INPUT)
@SendTo(Processor.OUTPUT)
public List<XYZObject> getAll(
XYZInput inp) {
List<XYZObject> xyzs = dbService.findAllByDataType(inp.getDataType());
return xyzs;
}
这个流具有RabbitMQ中间件,我的接收器如下所示:
@StreamListener(Sink.INPUT)
public void writeToX(XYZInput input) {
....
}
我查看了一个类似的讨论[使用Kafka Binder的类似问题](https://stackoverflow.com/questions/62087870/spring-dataflow-processor-to-process-one-payload-and-write-multiple-rows-in-data)。如何在Rabbit binder中实现这个目标?
使用RabbitMQ作为绑定器是否可行?
英文:
My Processor process one payload and produce a List
@StreamListener(Processor.INPUT)
@SendTo(Processor.OUTPUT)
public List<XYZObject> getAll(
XYZInput inp) {
List<XYZObject> xyzs = dbService.findAllByDataType(inp.getDataType());
return xyzs;
}
The stream has RabbitMQ middleware, and my sink looks like below:
@StreamListener(Sink.INPUT)
public void writeToX(XYZInput input) {
....
}
I took a look into a similar discussion Similar Problem with Kafka Binder. How to achieve this with Rabbit binder?
Is it achieveable with RabbitMQ as binder?
答案1
得分: 1
这是一个关于Spring Cloud Stream的问题,由spring.cloud.stream.bindings.<binding-name>.consumer.batch-mode
属性控制。
请查看参考指南中的批量消费者/生产者部分以获取更多信息。
英文:
This is a Spring Cloud Stream question and is controlled by the spring.cloud.stream.bindings.<binding-name>.consumer.batch-mode
property.
Please see the reference guide section for Batch consumers/producers to learn more.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论