事件,频道,主题有什么区别?
通过参考Kafka,所有这些有什么区别?
可以说,我有一个组件“顺序”,当我创建/取消/修改订单时,必须将事件发射到kafka-channel中。
我创建了一个频道。作为“订购”。主题是我可以在此频道中使用的名称吗? 什么是主题与频道?
这是订单范围的组件。创建&维护所有此类命令的记录。 我想在此组件的订阅者部分中使用一个orderevents类。
public class OrderEvents {
public static final String ORDER_CREATED = "ORDER_CREATED";
public static final String ORDER_MODIFIED = "ORDER_MODIFIED";
public static final String ORDER_CANCELLED = "ORDER_CANCELLED";
}
With refernce to Kafka, what is the difference between all these?
Lets say I have a component "Order" which must emit events into a kafka-channel when I create/cancel/modify orders.
And I create a channel. As "Order-out". Is topic the name I can use for this channel?
What is topic vs channel?
And this is the Order-Details component. Which creates & maintains records of all such orders.
I want to use an orderEvents class inside subscriber section of this component.
public class OrderEvents {
public static final String ORDER_CREATED = "ORDER_CREATED";
public static final String ORDER_MODIFIED = "ORDER_MODIFIED";
public static final String ORDER_CANCELLED = "ORDER_CANCELLED";
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事件是单一记录。在春季,您可能会使用
消息
类来包装事件。频道为 spring Integration> spring Integration> spring Integration 通过Spring-kafka或输入和输出的粘合剂。活页夹确定频道的实现。
主题是组织的Kafka单位。
事件将被序列化为字节,并通过频道发送到KAFKA主题。
Kafka记录将从Kafka主题中通过频道消耗,并将其划分为应用程序事件类。
An event is a single record. In Spring, you might work with a
Message
class to wrap an event.Channel is a Spring Integration term used via Spring-Kafka or Spring Cloud Stream Binders for inputs and outputs. A Binder determines the implementation of the Channel.
Topic is a Kafka unit of organization.
An event will be serialized into bytes, and sent via a channel to a Kafka topic.
A Kafka record will be consumed from a Kafka topic, through a channel, and deserialized into an application event class.