use of org.apache.camel.component.timer.TimerComponent in project camel by apache.
the class TimerComponentAutoConfiguration method configureTimerComponent.
@Lazy
@Bean(name = "timer-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(TimerComponent.class)
public TimerComponent configureTimerComponent(CamelContext camelContext) throws Exception {
TimerComponent component = new TimerComponent();
component.setCamelContext(camelContext);
return component;
}
use of org.apache.camel.component.timer.TimerComponent in project camel by apache.
the class TimerComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
TimerComponent comp = context.getComponent("timer", TimerComponent.class);
EndpointConfiguration conf = comp.createConfiguration("timer:foo?period=2000");
assertEquals("2000", conf.getParameter("period"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"timerName\": { \"kind\": \"path\", \"displayName\": \"Timer Name\", \"group\": \"consumer\", \"required\": true"));
assertTrue(json.contains("\"delay\": { \"kind\": \"parameter\", \"displayName\": \"Delay\", \"group\": \"consumer\", \"type\": \"integer\""));
assertTrue(json.contains("\"timer\": { \"kind\": \"parameter\", \"displayName\": \"Timer\", \"group\": \"advanced\", \"label\": \"advanced\""));
}
use of org.apache.camel.component.timer.TimerComponent in project camel by apache.
the class AddComponentInConfigureBuilder method configure.
@Override
public void configure() throws Exception {
ModelCamelContext context = getContext();
TimerComponent timerComponent = new TimerComponent();
getContext().addComponent("my-timer", timerComponent);
from("my-timer://test-timer?period=1000").to("mock://result");
}
Aggregations