final CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
connectionFactory.setHost("localhost");
ThreadPoolTaskExecutor exec = new ThreadPoolTaskExecutor();
final String execName = "make-sure-exec-passed-in";
exec.setBeanName(execName);
exec.afterPropertiesSet();
connectionFactory.setExecutor(exec);
final Field[] fields = new Field[1];
ReflectionUtils.doWithFields(RabbitTemplate.class, new FieldCallback() {
@Override
public void doWith(Field field) throws IllegalArgumentException,