I am learning about Reactive Streams in API and I am struck by the similarity between this and JMS. In JMS too we have asynchronous processing, publishers and subscribers. What perspective am I missing in making this equivalence?
Reactive Streams is back pressure oriented, JMS is message oriented. Although you could do back pressure using JMS.
Blocking API (non-reactive)
java.util.concurrent.Future::get
<-> javax.jms.MessageConsumer.receive
Non-blocking API
org.reactivestreams.Publisher::subscribe
<-> javax.jms.MessageConsumer::setMessageListener
org.reactivestreams.Subscriber::onNext
<-> javax.jms.MessageListener::onMessage
Back pressure API <-> Message API
org.reactivestreams.Subscription::request
<-> javax.jms.MessageProducer::send
Initialization / finalization / error-handling
org.reactivestreams.Subscriber::onSubscribe
<-> javax.jms.MessageListener::onMessage
org.reactivestreams.Subscriber::onError
<-> javax.jms.MessageListener::onMessage
org.reactivestreams.Subscriber::onComplete
<-> javax.jms.MessageListener::onMessage
org.reactivestreams.Subscription::cancel
<-> javax.jms.MessageProducer::send
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With