Merge remote-tracking branch 'origin/2.1.x' into 2.1.x

This commit is contained in:
Olga Maciaszek-Sharma
2019-09-18 11:39:46 +02:00

View File

@@ -76,7 +76,7 @@ public class CamelStubMessages implements MessageVerifier<Message> {
ConsumerTemplate consumerTemplate = this.context.createConsumerTemplate();
Exchange exchange = consumerTemplate.receive(destination,
timeUnit.toMillis(timeout));
return exchange.getIn();
return exchange != null ? exchange.getIn() : null;
}
catch (Exception e) {
log.error("Exception occurred while trying to read a message from "