- Hands-On Reactive Programming with Reactor
- Rahul Sharma
- 166字
- 2021-08-13 15:22:55
Java Messaging Service API
Let's look at how Reactive Streams compares to the Java Messaging Service (JMS) API. The JMS specification describes a Queue and a Topic, to which a producer and a consumer can connect:
@Resource(lookup = "jms/Queue")
private static Queue queue;
@Resource(lookup = "jms/Topic")
private static Topic topic;
Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(queue);
MessageConsumer consumer = session.createConsumer(topic)
Here, the producer is responsible for generating unbounded events on the queue or topics, while the consumer actively consumes the events. The producer and consumer are working in isolation, at their own rates. The task of managing the subscription is taken care of by the JMS broker. This is different from the Subscription API, where backpressure plays a major role in event generation. There is also no event modeling, like subscription, error, or completion. The JMS connection is like a never-ending stream of data. It cannot provide completion or error events. If we need to support this, custom objects must be modeled first.
- Internet接入·網(wǎng)絡(luò)安全
- Hands-On Data Science with SQL Server 2017
- 微型計算機(jī)控制技術(shù)
- 計算機(jī)網(wǎng)絡(luò)應(yīng)用基礎(chǔ)
- 最簡數(shù)據(jù)挖掘
- iClone 4.31 3D Animation Beginner's Guide
- 機(jī)器學(xué)習(xí)流水線實戰(zhàn)
- 精通特征工程
- Android游戲開發(fā)案例與關(guān)鍵技術(shù)
- Docker on Amazon Web Services
- 單片機(jī)C語言程序設(shè)計完全自學(xué)手冊
- Visual FoxPro程序設(shè)計
- Learning ServiceNow
- 大數(shù)據(jù)案例精析
- 計算智能算法及其生產(chǎn)調(diào)度應(yīng)用