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.
-
RendezvousChannel
extendsQueueChannel
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 aSynchronousQueue
. 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, section 3.2.4), have a look at the source code of thedoSendAndReceive
method ofMessageChannelTemplate
. That one usesPollableChannel
implementation internally, but the pattern could be easily transferedRendezvousChannel
.
0 comments:
Post a Comment