use of org.apache.camel.component.atmos.integration.consumer.AtmosScheduledPollGetConsumer in project camel by apache.
the class AtmosEndpoint method createConsumer.
/**
* Create one of the camel consumer available based on the configuration
*
* @param processor the given processor
* @return the camel consumer
* @throws Exception
*/
public Consumer createConsumer(Processor processor) throws Exception {
LOG.debug("resolve consumer atmos endpoint {" + configuration.getOperation().toString() + "}");
LOG.debug("resolve consumer atmos attached client:" + configuration.getClient());
AtmosScheduledPollConsumer consumer;
if (this.configuration.getOperation() == AtmosOperation.get) {
consumer = new AtmosScheduledPollGetConsumer(this, processor, configuration);
consumer.setDelay(POLL_CONSUMER_DELAY);
return consumer;
} else {
throw new AtmosException("operation specified is not valid for consumer!");
}
}
use of org.apache.camel.component.atmos.integration.consumer.AtmosScheduledPollGetConsumer in project camel by apache.
the class AtmosConsumerTest method shouldCreateGetConsumer.
@Test
public void shouldCreateGetConsumer() throws Exception {
// Given
AtmosEndpoint atmosEndpoint = context.getEndpoint("atmos:foo/get?remotePath=/path", AtmosEndpoint.class);
// When
Consumer consumer = atmosEndpoint.createConsumer(null);
// Then
Assert.assertTrue(consumer instanceof AtmosScheduledPollGetConsumer);
assertEquals("foo", atmosEndpoint.getConfiguration().getName());
}
Aggregations