- 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ò)安全
- Learning Microsoft Azure Storage
- Effective DevOps with AWS
- 城市道路交通主動控制技術(shù)
- AutoCAD 2012中文版繪圖設(shè)計(jì)高手速成
- 精通數(shù)據(jù)科學(xué)算法
- 智能生產(chǎn)線的重構(gòu)方法
- SAP Business Intelligence Quick Start Guide
- R Data Analysis Projects
- 3ds Max造型表現(xiàn)藝術(shù)
- 設(shè)計(jì)模式
- 機(jī)器學(xué)習(xí)案例分析(基于Python語言)
- Hands-On DevOps
- 新一代人工智能與語音識別
- 分布式Java應(yīng)用