Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Integration: How does RendezvousChannel work?

Tags:

spring

I haven't been able to find any examples of how the RendezvousChannel works in Spring Integration. Does anyone know of any resources?

I've read that RendezvousChannel is useful for adapting request/response clients to the asynchronous messaging in Spring Integration.

like image 455
Mike Sickler Avatar asked Dec 29 '25 06:12

Mike Sickler


1 Answers

RendezvousChannel extends QueueChannel and exhibits the same behaviour:

  • Reading from the channel blocks until either a message is available or a timeout occurs.
  • Writing to the channel blocks until the queue's capacity permits another message or a timeout occurs.

Internally however, RendezvousChannel uses a capacity of 0 in conjunction with a SynchronousQueue. Therefore, senders will block until receivers have finished, well, receiving and vice versa, basically establishing synchronous communication.

As for examples, I don't think there are any yet.

If you want to get an impression of how RendezvousChannel can be used as temporary reply channel for implementing request/reply scenarios (as hinted at in the reference documentation spring channel-implementations, section 4.1.2), have a look at the source code of the sendAndReceive method of MessageChannelTemplate. That one uses PollableChannel implementation internally, but the pattern could be easily transfered RendezvousChannel.

like image 197
Nils Wloka Avatar answered Jan 01 '26 17:01

Nils Wloka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!