byte[] body = exchange.getIn().getBody(byte[].class);
if (body != null) {
MQTTConfiguration configuration = mqttEndpoint.getConfiguration();
boolean retain = exchange.getProperty(configuration.getMqttRetainPropertyName(), configuration.isByDefaultRetain(), Boolean.class);
QoS qoS = configuration.getQoS();
Object qoSValue = exchange.getProperty(configuration.getMqttQosPropertyName());
if (qoSValue != null) {
qoS = MQTTConfiguration.getQoS(qoSValue.toString());
}