flume
flume copied to clipboard
Example showing request + response
I know it's pretty custom and not a typical usecase but I think it'd be pretty cool to show the power of the library to show how to do exact request + response. aka, tx, wait for rx back, but don't risk getting the rx from a different tx out of order.
I agree, an example of this would be useful! I'll see whether I get time to add one in the next few weeks.
Is this possible without some kind of request/reply correlation IDs? my fear is that you would transmit a message, then switch to being a receiver, but receive a response to a message that you didn’t just transmit. For example like out of order
Flume guarantees ordering from the perspective of a particular thread. In general, you'd probably want to have two channels for this to work: one to send on, one to receive on. You also wouldn't want to share them between many threads because the messages might be received by the wrong thread.
can you think of a way to solve multi-threaded exact request/response with channels or not really?
Is this possible without some kind of request/reply correlation IDs? my fear is that you would transmit a message, then switch to being a receiver, but receive a response to a message that you didn’t just transmit. For example like out of order
The way this works in xtra is by using Flume one channel from sender to receiver, and sending a oneshot channel half along with the request that needs a response. There are alternate designs of course - maybe using IDs like you said.