0

I am trying to understand the difference between Reactive Extensions and Message Queue? Are they competing frameworks? Can they be used in conjuction? Started programming, and trying to understand this.

Reactive Extensions: " The Reactive Extensions (Rx) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators."

Message Queue: "A message queue is a queue of messages sent between applications. It includes a sequence of work objects that are waiting to be processed. "

2
  • 2
    They are two completely different things. What makes you think they are similar?
    – Euphoric
    Oct 8, 2019 at 6:42
  • 3
    A "message queue" generically is just a list of data designed to induce behaviour in a different part of a system (maybe synchronously or not), where the elements in the list are processed in FIFO order, and typically by a part of the system that is not closely coupled to the parts which add the elements into the queue. Reactive Extensions is a set of tools designed for manipulating the temporal aspects of data flows in a system - whereas a lot of data manipulation involves specifying what processing occurs, Rx is designed to alter when processing occurs.
    – Steve
    Oct 8, 2019 at 9:10

2 Answers 2

1

Are they competing frameworks?

No, these are not competing and they are very different ideas.

RX is a library that is frequently used in applications that require real-time processing over a stream of events. RX gives you a library of functions to perform this with ease.

Message Queue (MQ) is more of an architecture component than a library. MQs are used to decouple event-producing logic and event-consuming logic. Example: on a user sign up page, you may want to perform a series of actions; one of it is sending of a welcome email to user. You may decide that you do not want the user to wait too long on the loading screen, therefore you use an MQ to simply trigger a “send welcome email” event to be processed later.

Can they be used in conjuction?

Yes. For example, in a file processing application -

1) Use RX to process a stream of CSV records

2) You can combine records, transform, etc

3) Take the final result and put it into a queue, then move on to next batch of CSV records

4) Meanwhile, a queue consumer reads that result above and performs an upload of the result to a remote file server

0

A "message queue" generically is just a list of data designed to induce behaviour in a different part of a system (maybe synchronously or not), where the elements in the list are processed in FIFO order, and typically by a part of the system that is not closely coupled to the parts which add the elements into the queue. Reactive Extensions is a set of tools designed for manipulating the temporal aspects of data flows in a system - whereas a lot of data manipulation involves specifying what processing occurs, Rx is designed to alter when processing occurs.

-- Steve Oct 8 '19 at 9:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.