spring-projects/spring-framework — pull request #365 by wilkinsona (2013-09-27 10:40:25+00:00)
Title: Send heartbeats to the broker from the system relay session using forward

Previously, heartbeats being sent to the broker by the system relay
session were being sent by directly performing a connection.send. This
bypassed useful logic for failure handling etc in the code path of
forward. This commit changes the system relay session to send
heartbeats to the broker using forward instead.

This change unearthed a problem with forwarding: it was blocking the
thread until the send had completed, so if the thread that was
triggering the send was also the thread that TcpClient needed to use
to actually perform the send, it wouldn't complete.

The blocking was only necessary to allow forwardInternal to return a
boolean indicating whether or not the forwarding was successful.
However, this return value was not used by any of the method's
callers. The blocking has been removed.