use of org.apache.camel.impl.SimpleRegistry in project camel by apache.
the class KinesisEndpointTest method setup.
@Before
public void setup() throws Exception {
SimpleRegistry registry = new SimpleRegistry();
registry.put("kinesisClient", amazonKinesisClient);
camelContext = new DefaultCamelContext(registry);
}
use of org.apache.camel.impl.SimpleRegistry in project camel by apache.
the class KinesisFirehoseEndpointTest method setup.
@Before
public void setup() throws Exception {
SimpleRegistry registry = new SimpleRegistry();
registry.put("firehoseClient", amazonKinesisFirehoseClient);
camelContext = new DefaultCamelContext(registry);
}
use of org.apache.camel.impl.SimpleRegistry in project camel by apache.
the class PropertiesComponentRestartTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
final PropertiesComponent pc = new PropertiesComponent("classpath:org/apache/camel/component/properties/myproperties.properties");
pc.setPropertiesResolver(new PropertiesResolver() {
public Properties resolveProperties(CamelContext context, boolean ignoreMissingLocation, List<PropertiesLocation> locations) throws Exception {
resolvedCount++;
return new DefaultPropertiesResolver(pc).resolveProperties(context, ignoreMissingLocation, locations);
}
});
// put the properties component into the registry so that it survives restarts
SimpleRegistry registry = new SimpleRegistry();
registry.put("properties", pc);
return new DefaultCamelContext(registry);
}
use of org.apache.camel.impl.SimpleRegistry in project camel by apache.
the class ManagedRestRegistryTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
SimpleRegistry registry = new SimpleRegistry();
registry.put("dummy-test", new DummyRestConsumerFactory());
return new DefaultCamelContext(registry);
}
use of org.apache.camel.impl.SimpleRegistry in project chuidiang-ejemplos by chuidiang.
the class RouteBinMain method startCamel.
private static CamelContext startCamel() throws Exception {
SimpleRegistry registry = new SimpleRegistry();
registry.put("FromDecoder", new MessageDecoder());
registry.put("FromEncoder", new MessageEncoder());
registry.put("ToDecoder", new MessageDecoder());
registry.put("ToEncoder", new MessageEncoder());
final CamelContext context = new DefaultCamelContext(registry);
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
createNettyRoute();
}
protected void createNettyRoute() {
from("netty:tcp://localhost:55559?encoder=#FromEncoder&" + "decoder=#FromDecoder&" + "disconnectOnNoReply=false&" + "serverClosedChannelExceptionCaughtLogLevel=WARN&" + "keepAlive=true").to("netty:tcp://localhost:55560?encoder=#ToEncoder&" + "decoder=#ToDecoder&" + "disconnectOnNoReply=false&" + "serverClosedChannelExceptionCaughtLogLevel=WARN&" + "keepAlive=true").setId("myRoute");
}
});
context.start();
return context;
}
Aggregations