Search in sources :

Example 56 with SimpleRegistry

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);
}
Also used : SimpleRegistry(org.apache.camel.impl.SimpleRegistry) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) Before(org.junit.Before)

Example 57 with SimpleRegistry

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);
}
Also used : SimpleRegistry(org.apache.camel.impl.SimpleRegistry) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) Before(org.junit.Before)

Example 58 with SimpleRegistry

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);
}
Also used : CamelContext(org.apache.camel.CamelContext) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) SimpleRegistry(org.apache.camel.impl.SimpleRegistry) Properties(java.util.Properties) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext)

Example 59 with SimpleRegistry

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);
}
Also used : SimpleRegistry(org.apache.camel.impl.SimpleRegistry) DummyRestConsumerFactory(org.apache.camel.component.rest.DummyRestConsumerFactory) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext)

Example 60 with SimpleRegistry

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;
}
Also used : CamelContext(org.apache.camel.CamelContext) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) RouteBuilder(org.apache.camel.builder.RouteBuilder) SimpleRegistry(org.apache.camel.impl.SimpleRegistry) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException)

Aggregations

SimpleRegistry (org.apache.camel.impl.SimpleRegistry)60 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)57 CamelContext (org.apache.camel.CamelContext)35 Test (org.junit.Test)25 RouteBuilder (org.apache.camel.builder.RouteBuilder)14 Before (org.junit.Before)8 FailedToCreateRouteException (org.apache.camel.FailedToCreateRouteException)5 ActiveMQConnectionFactory (org.apache.activemq.ActiveMQConnectionFactory)4 Component (org.apache.camel.Component)4 Exchange (org.apache.camel.Exchange)4 DummyRestConsumerFactory (org.apache.camel.component.rest.DummyRestConsumerFactory)4 HashMap (java.util.HashMap)3 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)3 SjmsComponent (org.apache.camel.component.sjms.SjmsComponent)3 Config (com.hazelcast.config.Config)2 HazelcastInstance (com.hazelcast.core.HazelcastInstance)2 Properties (java.util.Properties)2 ConnectionFactory (javax.jms.ConnectionFactory)2 FileComponent (org.apache.camel.component.file.FileComponent)2 HystrixConfigurationDefinition (org.apache.camel.model.HystrixConfigurationDefinition)2