use of org.apache.camel.impl.DefaultConsumerTemplate in project camel by apache.
the class CamelContextAwareTest method testCamelTemplates.
public void testCamelTemplates() throws Exception {
DefaultProducerTemplate producer1 = getMandatoryBean(DefaultProducerTemplate.class, "producer1");
assertEquals("Inject a wrong camel context", producer1.getCamelContext().getName(), "camel1");
DefaultProducerTemplate producer2 = getMandatoryBean(DefaultProducerTemplate.class, "producer2");
assertEquals("Inject a wrong camel context", producer2.getCamelContext().getName(), "camel2");
DefaultConsumerTemplate consumer = getMandatoryBean(DefaultConsumerTemplate.class, "consumer");
assertEquals("Inject a wrong camel context", consumer.getCamelContext().getName(), "camel2");
}
use of org.apache.camel.impl.DefaultConsumerTemplate in project camel by apache.
the class ConsumerTemplateAutoRegisterTest method testHasTemplate.
@Test
public void testHasTemplate() {
assertNotNull("Should have injected a consumer template", template);
assertNotNull("The template context should not be null", ((DefaultConsumerTemplate) template).getCamelContext());
ConsumerTemplate lookup = context.getRegistry().lookupByNameAndType("consumerTemplate", ConsumerTemplate.class);
assertNotNull("Should lookup consumer template", lookup);
}
use of org.apache.camel.impl.DefaultConsumerTemplate in project camel by apache.
the class AbstractCamelConsumerTemplateFactoryBean method getObject.
public ConsumerTemplate getObject() throws Exception {
template = new DefaultConsumerTemplate(getCamelContext());
// set custom cache size if provided
if (maximumCacheSize != null) {
template.setMaximumCacheSize(maximumCacheSize);
}
// must start it so its ready to use
ServiceHelper.startService(template);
return template;
}
Aggregations