Search in sources :

Example 1 with KnativeComponent

use of org.apache.camel.component.knative.KnativeComponent in project camel-k-runtime by apache.

the class KnativeProducerRecorder method createKnativeProducerFactoryCustomizer.

public RuntimeValue<ComponentCustomizer> createKnativeProducerFactoryCustomizer(Supplier<Vertx> vertx) {
    KnativeHttpProducerFactory factory = new KnativeHttpProducerFactory();
    factory.setVertx(vertx.get());
    ComponentCustomizer cf = new ComponentCustomizer() {

        @Override
        public void configure(String name, Component target) {
            if (target instanceof KnativeComponent) {
                ((KnativeComponent) target).setProducerFactory(factory);
            }
        }
    };
    return new RuntimeValue<>(cf);
}
Also used : ComponentCustomizer(org.apache.camel.spi.ComponentCustomizer) KnativeComponent(org.apache.camel.component.knative.KnativeComponent) RuntimeValue(io.quarkus.runtime.RuntimeValue) Component(org.apache.camel.Component) KnativeComponent(org.apache.camel.component.knative.KnativeComponent) KnativeHttpProducerFactory(org.apache.camel.component.knative.http.KnativeHttpProducerFactory)

Example 2 with KnativeComponent

use of org.apache.camel.component.knative.KnativeComponent in project camel-k-runtime by apache.

the class KnativeConsumerRecorder method createKnativeConsumerFactoryCustomizer.

public RuntimeValue<ComponentCustomizer> createKnativeConsumerFactoryCustomizer(RuntimeValue<Router> router) {
    KnativeHttpConsumerFactory factory = new KnativeHttpConsumerFactory();
    factory.setRouter(router.getValue());
    ComponentCustomizer cf = new ComponentCustomizer() {

        @Override
        public void configure(String name, Component target) {
            if (target instanceof KnativeComponent) {
                ((KnativeComponent) target).setConsumerFactory(factory);
            }
        }
    };
    return new RuntimeValue<>(cf);
}
Also used : ComponentCustomizer(org.apache.camel.spi.ComponentCustomizer) KnativeComponent(org.apache.camel.component.knative.KnativeComponent) RuntimeValue(io.quarkus.runtime.RuntimeValue) KnativeHttpConsumerFactory(org.apache.camel.component.knative.http.KnativeHttpConsumerFactory) Component(org.apache.camel.Component) KnativeComponent(org.apache.camel.component.knative.KnativeComponent)

Aggregations

RuntimeValue (io.quarkus.runtime.RuntimeValue)2 Component (org.apache.camel.Component)2 KnativeComponent (org.apache.camel.component.knative.KnativeComponent)2 ComponentCustomizer (org.apache.camel.spi.ComponentCustomizer)2 KnativeHttpConsumerFactory (org.apache.camel.component.knative.http.KnativeHttpConsumerFactory)1 KnativeHttpProducerFactory (org.apache.camel.component.knative.http.KnativeHttpProducerFactory)1