try {
answer = endpoint.createProducer();
// must then start service so producer is ready to be used
ServiceHelper.startService(answer);
} catch (Exception e) {
throw new FailedToCreateProducerException(endpoint, e);
}
// add producer to cache or pool if applicable
if (pooled && answer instanceof ServicePoolAware) {
LOG.debug("Adding to producer service pool with key: {} for producer: {}", endpoint, answer);