return message;
}
};
CamelJmsTemplate template = null;
CamelJmsTeemplate102 template102 = null;
if (endpoint.isUseVersion102()) {
template102 = (CamelJmsTeemplate102)getInOutTemplate();
} else {
template = (CamelJmsTemplate)getInOutTemplate();
}
if (LOG.isDebugEnabled()) {
LOG.debug("Using JMS API " + (endpoint.isUseVersion102() ? "v1.0.2" : "v1.1"));
}
if (destinationName != null) {
if (template != null) {
template.send(destinationName, messageCreator, callback);
} else {
template102.send(destinationName, messageCreator, callback);
}
} else if (destination != null) {
if (template != null) {
template.send(destination, messageCreator, callback);
} else {
template102.send(destination, messageCreator, callback);
}
} else {
throw new IllegalArgumentException("Neither destination nor destinationName is specified on this endpoint: " + endpoint);
}