我正在尝试用kafka绑定构建一个简单的云流应用程序。让我来描述一下布景。1.我有一个制作topic_1的制作人。
有一个流绑定器,将一些处理后的topic_2.绑定到topic_1中
@StreamListener(MyBinder.INPUT)
@SendTo(MyBinder.OUTPUT_2)
public String handleIncomingMsgs(String s) {
logger.info(s); // prints all the messages
return s;
}当生产者产生消息时,messages.
@Service
@EnableBinding(MyBinder.class)
public class LogMsg {
@StreamListener(MyBinder.OUTPUT_2)
public void handle(String board) {
logger.info("Received payload: " + board); //prints every alternate messages
}public interface ViewsStreams {
String INPUT = "input";
String OUTPUT_1 = "output_1";
String OP_USERS = "output_2";
@Autowired
@Input(INPUT)
SubscribableChannel job_board_views();
@Autowired
@Output(OUTPUT_1)
MessageChannel outboundJobBoards();
@Autowired
@Output(OUTPUT_2)
MessageChannel outboundUsers();
}我是这些技术的新手。不知道这里到底出了什么问题。有人能帮忙吗?
发布于 2019-09-26 12:49:11
您的猜测是正确的;在OUTPUT_2通道上有两个使用者--侦听器和发送消息的绑定。
他们每个人都会收到另一条消息。
https://stackoverflow.com/questions/58110643
复制相似问题