return resultMessageLabel == null ? null : mepClient.getMessageContext(resultMessageLabel);
}
public void afterReceive() throws Exception {
if (sender instanceof ManagementSupport) {
ManagementSupport sender = (ManagementSupport)this.sender;
synchronized (metrics) {
long start = System.currentTimeMillis();
while (true) {
try {
Assert.assertEquals(1, metrics.getMessagesSent());
Assert.assertEquals(messagesSent+1, sender.getMessagesSent());
long thisBytesSent = metrics.getBytesSent();
Assert.assertTrue("No increase in bytes sent in message level metrics", thisBytesSent != 0);
long newBytesSent = sender.getBytesSent();
Assert.assertTrue("No increase in bytes sent in transport level metrics", newBytesSent > bytesSent);
Assert.assertEquals("Mismatch between message and transport level metrics", thisBytesSent, newBytesSent - bytesSent);
break;
} catch (AssertionFailedError ex) {
// SYNAPSE-491: Maybe the transport sender didn't finish updating the