else if (payload instanceof String) {
try {
return Double.parseDouble((String) payload);
}
catch (Exception e) {
throw new MessagingException("cannot convert payload to double", e);
}
}
}
throw new MessagingException("cannot convert "
+ (payload == null ? "null" : payload.getClass().getName() + " to double"));
}