[GitHub] [camel-k] lburgazzoli commented on issue #959: Include camel-k-runtime version in camel-catalog
lburgazzoli commented on issue #959: Include camel-k-runtime version in camel-catalog URL: https://github.com/apache/camel-k/issues/959#issuecomment-538328237 not today, likely next week This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-k] astefanutti commented on issue #939: Add Kamel CLI download link in OpenShift Web console
astefanutti commented on issue #939: Add Kamel CLI download link in OpenShift Web console URL: https://github.com/apache/camel-k/issues/939#issuecomment-538330623 @nicolaferraro I'm working on it but still testing and polishing. Better move it to M3 and release M2 ASAP. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel
lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331430884 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelProducers.java ## @@ -16,51 +16,41 @@ */ package org.apache.camel.quarkus.core.runtime; -import javax.enterprise.context.ApplicationScoped; import javax.enterprise.inject.Produces; +import javax.inject.Singleton; import org.apache.camel.CamelContext; import org.apache.camel.ConsumerTemplate; import org.apache.camel.ProducerTemplate; import org.apache.camel.spi.Registry; -@ApplicationScoped +@Singleton public class CamelProducers { +private CamelContext context; Review comment: this is set by a recorder, don't know if make any difference This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel
lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331442824 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRecorder.java ## @@ -16,88 +16,98 @@ */ package org.apache.camel.quarkus.core.runtime; -import io.quarkus.arc.runtime.BeanContainerListener; +import java.util.function.Supplier; + +import io.quarkus.arc.runtime.BeanContainer; import io.quarkus.runtime.RuntimeValue; -import io.quarkus.runtime.ShutdownContext; import io.quarkus.runtime.annotations.Recorder; -import org.apache.camel.RoutesBuilder; -import org.apache.camel.quarkus.core.runtime.support.FastCamelRuntime; +import org.apache.camel.CamelContext; +import org.apache.camel.ExtendedCamelContext; +import org.apache.camel.RuntimeCamelException; +import org.apache.camel.quarkus.core.runtime.support.FastCamelContext; +import org.apache.camel.quarkus.core.runtime.support.FastModel; +import org.apache.camel.quarkus.core.runtime.support.RuntimeRegistry; import org.apache.camel.spi.Registry; +import org.graalvm.nativeimage.ImageInfo; @Recorder public class CamelRecorder { -public RuntimeValue create(Registry registry) { - -FastCamelRuntime fcr = new FastCamelRuntime(); -fcr.setRegistry(registry); - -return new RuntimeValue<>(fcr); -} - -public void init( -RuntimeValue runtime, -CamelConfig.BuildTime buildTimeConfig) { - -FastCamelRuntime fcr = (FastCamelRuntime) runtime.getValue(); -fcr.init(buildTimeConfig); +public RuntimeValue createRegistry() { +return new RuntimeValue<>(new RuntimeRegistry()); } -public void start( -ShutdownContext shutdown, -RuntimeValue runtime, -CamelConfig.Runtime runtimeConfig) throws Exception { +@SuppressWarnings("unchecked") +public RuntimeValue createContext(RuntimeValue registry, BeanContainer beanContainer, CamelConfig.BuildTime buildTimeConfig) { Review comment: I don't think we need to explicit the phase here as for the recorder POV, it does not matter. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-k] nicolaferraro commented on issue #939: Add Kamel CLI download link in OpenShift Web console
nicolaferraro commented on issue #939: Add Kamel CLI download link in OpenShift Web console URL: https://github.com/apache/camel-k/issues/939#issuecomment-538327414 @astefanutti are you working on this. I was planning to start releasing 1.0.0-M2 this afternoon. We can move it to M3 if you prefer. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-k] nicolaferraro commented on issue #959: Include camel-k-runtime version in camel-catalog
nicolaferraro commented on issue #959: Include camel-k-runtime version in camel-catalog URL: https://github.com/apache/camel-k/issues/959#issuecomment-538327756 @lburgazzoli I see some commits going around.. do you plan to solve this today or we move it to M3? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel
lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331431933 ## File path: extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/support/CamelMainBuildItem.java ## @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.main.deployment.support; + +import io.quarkus.builder.item.SimpleBuildItem; +import io.quarkus.runtime.RuntimeValue; +import org.apache.camel.quarkus.main.CamelMain; + +public final class CamelMainBuildItem extends SimpleBuildItem { Review comment: they don't need to be separate, probably a leftover of something I was working on This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel
lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331371275 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelContext.java ## @@ -365,11 +388,12 @@ public AsyncProcessor createMulticast(Collection processors, Executor @SuppressWarnings("unchecked") protected T resolve(Class clazz, String type, String name, CamelContext context) { Review comment: it was originally used to auto configure component, languages and data formats but it is not more needed now as MainSupport does it, let me revisit it This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-k] jacobborella opened a new issue #982: Operator fails on minikube
jacobborella opened a new issue #982: Operator fails on minikube URL: https://github.com/apache/camel-k/issues/982 Hi. I would like to contribute to this awesome project, so as a first thing, I set out to build the project as adviced in the contributing guide. I'm using minikube (v1.3.1) on a mac and after setting up the environment, I run `make install-minikube` The build is going through fine, but the operator fails: $ kubectl get pod NAMEREADY STATUS RESTARTS AGE camel-k-operator-5f8644979d-5wb6l 0/1 Error6 5m58s $ kubectl logs pod/camel-k-operator-5f8644979d-5wb6l standard_init_linux.go:211: exec user process caused "exec format error" I tried reverting to latest release 1.0.0-M1 and then everything works just fine. Can you please advice? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel
lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331431643 ## File path: extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/SubstrateProcessor.java ## @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.main.deployment; + +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.CombinedIndexBuildItem; +import io.quarkus.deployment.builditem.substrate.ReflectiveClassBuildItem; +import org.apache.camel.quarkus.core.deployment.CamelSupport; +import org.jboss.jandex.IndexView; + +public class SubstrateProcessor { Review comment: what do you mean by two processors ? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on issue #226: Use MainSupport as base for running Camel
lburgazzoli commented on issue #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#issuecomment-538349784 @ppalaga fixed your findings, at least, I think :) This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-k] astefanutti commented on issue #982: Operator fails on minikube
astefanutti commented on issue #982: Operator fails on minikube URL: https://github.com/apache/camel-k/issues/982#issuecomment-538332457 The `exec user process caused "exec format error"` happens when you've built the operator binary on another platform than the Linux one, which is the target platform when running in Minikube. I assume you're on another platform than Linux, so you can do: ``` $ GOOS=linux make images ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331405269 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelProducers.java ## @@ -16,51 +16,41 @@ */ package org.apache.camel.quarkus.core.runtime; -import javax.enterprise.context.ApplicationScoped; import javax.enterprise.inject.Produces; +import javax.inject.Singleton; import org.apache.camel.CamelContext; import org.apache.camel.ConsumerTemplate; import org.apache.camel.ProducerTemplate; import org.apache.camel.spi.Registry; -@ApplicationScoped +@Singleton Review comment: ```suggestion /** * Producers of beans that are injectable via CDI. */ @Singleton ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331393176 ## File path: extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/BuildProcessor.java ## @@ -67,151 +47,57 @@ @Record(ExecutionTime.STATIC_INIT) @BuildStep -CamelRuntimeBuildItem create( +CamelRegistryBuildItem registry( CamelRecorder recorder, -List camelBeans, -BuildProducer runtimeBeans) { +List registryItems) { -RuntimeRegistry registry = new RuntimeRegistry(); -RuntimeValue camelRuntime = recorder.create(registry); +RuntimeValue registry = recorder.createRegistry(); -getBuildTimeRouteBuilderClasses().forEach( -b -> recorder.addBuilder(camelRuntime, b) -); - -services().filter( -si -> camelBeans.stream().noneMatch( +CamelSupport.services(applicationArchivesBuildItem).filter( +si -> registryItems.stream().noneMatch( c -> Objects.equals(si.name, c.getName()) && c.getType().isAssignableFrom(si.type) ) ).forEach( si -> { LOGGER.debug("Binding camel service {} with type {}", si.name, si.type); recorder.bind( -camelRuntime, +registry, si.name, si.type ); } ); -for (CamelBeanBuildItem item: camelBeans) { +for (CamelBeanBuildItem item: registryItems) { LOGGER.debug("Binding item with name: {}, type {}", item.getName(), item.getType()); recorder.bind( -camelRuntime, +registry, item.getName(), item.getType(), item.getValue() ); } - runtimeBeans.produce(RuntimeBeanBuildItem.builder(CamelRuntime.class).setRuntimeValue(camelRuntime).build()); - -return new CamelRuntimeBuildItem(camelRuntime); +return new CamelRegistryBuildItem(registry); } @Record(ExecutionTime.STATIC_INIT) @BuildStep -AdditionalBeanBuildItem createProducers( -CamelRuntimeBuildItem runtime, +CamelContextBuildItem context( CamelRecorder recorder, -BuildProducer listeners) { - -listeners.produce(new BeanContainerListenerBuildItem(recorder.initRuntimeInjection(runtime.getRuntime(; - -return AdditionalBeanBuildItem.unremovableOf(CamelProducers.class); -} - -@Record(ExecutionTime.STATIC_INIT) -@BuildStep -void init( -// TODO: keep this field as we need to be sure ArC is initialized before starting events -// We need to re-evaluate the need of fire events from context once doing -// https://github.com/apache/camel-quarkus/issues/9 +CamelRegistryBuildItem registry, +// TODO: this add a dependency on Arc BeanContainerBuildItem beanContainerBuildItem, Review comment: I like that you use the param names without the `BuildItem` suffix elsewhere. You may want to rename also `beanContainerBuildItem` when you go around next time. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331422708 ## File path: extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/support/CamelMainBuildItem.java ## @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.main.deployment.support; + +import io.quarkus.builder.item.SimpleBuildItem; +import io.quarkus.runtime.RuntimeValue; +import org.apache.camel.quarkus.main.CamelMain; + +public final class CamelMainBuildItem extends SimpleBuildItem { Review comment: ```suggestion /** * Holds the {@link CamelMain} {@link RuntimeValue}. */ public final class CamelMainBuildItem extends SimpleBuildItem { ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331403147 ## File path: extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelSupport.java ## @@ -56,4 +69,67 @@ public static boolean isPublic(ClassInfo ci) { .flatMap(CamelSupport::safeWalk) .filter(Files::isRegularFile); } + +public static Stream getRouteBuilderClasses(IndexView view) { +Set allKnownImplementors = new HashSet<>(); +allKnownImplementors.addAll( + view.getAllKnownImplementors(DotName.createSimple(RoutesBuilder.class.getName(; +allKnownImplementors.addAll( + view.getAllKnownSubclasses(DotName.createSimple(RouteBuilder.class.getName(; +allKnownImplementors.addAll( + view.getAllKnownSubclasses(DotName.createSimple(AdviceWithRouteBuilder.class.getName(; + +return allKnownImplementors +.stream() +.filter(CamelSupport::isConcrete) +.filter(CamelSupport::isPublic) +.map(ClassInfo::toString); +} + +public static Stream services(ApplicationArchivesBuildItem applicationArchivesBuildItem) { +return CamelSupport.resources(applicationArchivesBuildItem, CamelSupport.CAMEL_SERVICE_BASE_PATH) +.map(CamelSupport::services) +.flatMap(Collection::stream); +} + +private static List services(Path p) { +List answer = new ArrayList<>(); + +String name = p.getFileName().toString(); +try (InputStream is = Files.newInputStream(p)) { +Properties props = new Properties(); +props.load(is); +for (Map.Entry entry : props.entrySet()) { +String k = entry.getKey().toString(); +if (k.equals("class")) { +String clazz = entry.getValue().toString(); +Class cl = Class.forName(clazz); + +answer.add(new ServiceInfo(name, cl)); +} +} +} catch (Exception e) { +throw new RuntimeException(e); +} + +return answer; +} + +public static class ServiceInfo { Review comment: JavaDoc please. A noun phrase would be enoungh. Something like `A description/metadata/identifier? of a Camel Service (typically found in {@code META-INF/services/org/apache/camel} of a jar?)` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel
lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331443049 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRecorder.java ## @@ -16,88 +16,98 @@ */ package org.apache.camel.quarkus.core.runtime; -import io.quarkus.arc.runtime.BeanContainerListener; +import java.util.function.Supplier; + +import io.quarkus.arc.runtime.BeanContainer; import io.quarkus.runtime.RuntimeValue; -import io.quarkus.runtime.ShutdownContext; import io.quarkus.runtime.annotations.Recorder; -import org.apache.camel.RoutesBuilder; -import org.apache.camel.quarkus.core.runtime.support.FastCamelRuntime; +import org.apache.camel.CamelContext; +import org.apache.camel.ExtendedCamelContext; +import org.apache.camel.RuntimeCamelException; +import org.apache.camel.quarkus.core.runtime.support.FastCamelContext; +import org.apache.camel.quarkus.core.runtime.support.FastModel; +import org.apache.camel.quarkus.core.runtime.support.RuntimeRegistry; import org.apache.camel.spi.Registry; +import org.graalvm.nativeimage.ImageInfo; @Recorder public class CamelRecorder { -public RuntimeValue create(Registry registry) { - -FastCamelRuntime fcr = new FastCamelRuntime(); -fcr.setRegistry(registry); - -return new RuntimeValue<>(fcr); -} - -public void init( -RuntimeValue runtime, -CamelConfig.BuildTime buildTimeConfig) { - -FastCamelRuntime fcr = (FastCamelRuntime) runtime.getValue(); -fcr.init(buildTimeConfig); +public RuntimeValue createRegistry() { +return new RuntimeValue<>(new RuntimeRegistry()); } -public void start( -ShutdownContext shutdown, -RuntimeValue runtime, -CamelConfig.Runtime runtimeConfig) throws Exception { +@SuppressWarnings("unchecked") +public RuntimeValue createContext(RuntimeValue registry, BeanContainer beanContainer, CamelConfig.BuildTime buildTimeConfig) { +FastCamelContext context = new FastCamelContext(); +context.setRegistry(registry.getValue()); +context.setLoadTypeConverters(false); +context.getTypeConverterRegistry().setInjector(context.getInjector()); -runtime.getValue().start(runtimeConfig); - -//in development mode undertow is started eagerly -shutdown.addShutdownTask(new Runnable() { -@Override -public void run() { -try { -runtime.getValue().stop(); -} catch (Exception e) { -throw new RuntimeException(e); +try { +if (buildTimeConfig.disableJaxb) { + context.adapt(ExtendedCamelContext.class).setModelJAXBContextFactory(() -> { +throw new UnsupportedOperationException(); +}); +} else { +// The creation of the JAXB context is very time consuming, so always prepare it +// when running in native mode, but lazy create it in java mode so that we don't +// waste time if using java routes +if (ImageInfo.inImageBuildtimeCode()) { + context.adapt(ExtendedCamelContext.class).getModelJAXBContextFactory().newJAXBContext(); } } -}); -} +} catch (Exception e) { +throw RuntimeCamelException.wrapRuntimeCamelException(e); +} -public void addBuilder( -RuntimeValue runtime, -String className) { +FastModel model = new FastModel(context); -FastCamelRuntime fcr = (FastCamelRuntime) runtime.getValue(); +context.setModel(model); +context.init(); -try { -fcr.getBuilders().add((RoutesBuilder) Class.forName(className).newInstance()); -} catch (Exception e) { -throw new RuntimeException(e); -} +// register to the container +beanContainer.instance(CamelProducers.class).setContext(context); + +return new RuntimeValue<>(context); } public void bind( -RuntimeValue runtime, +RuntimeValue runtime, String name, Class type, Object instance) { -runtime.getValue().getRegistry().bind(name, type, instance); +runtime.getValue().bind(name, type, instance); } public void bind( -RuntimeValue runtime, +RuntimeValue runtime, String name, Class type) { try { -runtime.getValue().getRegistry().bind(name, type, type.newInstance()); +runtime.getValue().bind(name, type, type.newInstance()); } catch (Exception e) { throw new RuntimeException(e); } } -public BeanContainerListener initRuntimeInjection(RuntimeValue runtime) { -
[GitHub] [camel-quarkus] lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel
lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331443025 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRecorder.java ## @@ -16,88 +16,98 @@ */ package org.apache.camel.quarkus.core.runtime; -import io.quarkus.arc.runtime.BeanContainerListener; +import java.util.function.Supplier; + +import io.quarkus.arc.runtime.BeanContainer; import io.quarkus.runtime.RuntimeValue; -import io.quarkus.runtime.ShutdownContext; import io.quarkus.runtime.annotations.Recorder; -import org.apache.camel.RoutesBuilder; -import org.apache.camel.quarkus.core.runtime.support.FastCamelRuntime; +import org.apache.camel.CamelContext; +import org.apache.camel.ExtendedCamelContext; +import org.apache.camel.RuntimeCamelException; +import org.apache.camel.quarkus.core.runtime.support.FastCamelContext; +import org.apache.camel.quarkus.core.runtime.support.FastModel; +import org.apache.camel.quarkus.core.runtime.support.RuntimeRegistry; import org.apache.camel.spi.Registry; +import org.graalvm.nativeimage.ImageInfo; @Recorder public class CamelRecorder { -public RuntimeValue create(Registry registry) { - -FastCamelRuntime fcr = new FastCamelRuntime(); -fcr.setRegistry(registry); - -return new RuntimeValue<>(fcr); -} - -public void init( -RuntimeValue runtime, -CamelConfig.BuildTime buildTimeConfig) { - -FastCamelRuntime fcr = (FastCamelRuntime) runtime.getValue(); -fcr.init(buildTimeConfig); +public RuntimeValue createRegistry() { +return new RuntimeValue<>(new RuntimeRegistry()); } -public void start( -ShutdownContext shutdown, -RuntimeValue runtime, -CamelConfig.Runtime runtimeConfig) throws Exception { +@SuppressWarnings("unchecked") +public RuntimeValue createContext(RuntimeValue registry, BeanContainer beanContainer, CamelConfig.BuildTime buildTimeConfig) { +FastCamelContext context = new FastCamelContext(); +context.setRegistry(registry.getValue()); +context.setLoadTypeConverters(false); +context.getTypeConverterRegistry().setInjector(context.getInjector()); -runtime.getValue().start(runtimeConfig); - -//in development mode undertow is started eagerly -shutdown.addShutdownTask(new Runnable() { -@Override -public void run() { -try { -runtime.getValue().stop(); -} catch (Exception e) { -throw new RuntimeException(e); +try { +if (buildTimeConfig.disableJaxb) { + context.adapt(ExtendedCamelContext.class).setModelJAXBContextFactory(() -> { +throw new UnsupportedOperationException(); +}); +} else { +// The creation of the JAXB context is very time consuming, so always prepare it +// when running in native mode, but lazy create it in java mode so that we don't +// waste time if using java routes +if (ImageInfo.inImageBuildtimeCode()) { + context.adapt(ExtendedCamelContext.class).getModelJAXBContextFactory().newJAXBContext(); } } -}); -} +} catch (Exception e) { +throw RuntimeCamelException.wrapRuntimeCamelException(e); +} -public void addBuilder( -RuntimeValue runtime, -String className) { +FastModel model = new FastModel(context); -FastCamelRuntime fcr = (FastCamelRuntime) runtime.getValue(); +context.setModel(model); +context.init(); -try { -fcr.getBuilders().add((RoutesBuilder) Class.forName(className).newInstance()); -} catch (Exception e) { -throw new RuntimeException(e); -} +// register to the container +beanContainer.instance(CamelProducers.class).setContext(context); + +return new RuntimeValue<>(context); } public void bind( -RuntimeValue runtime, +RuntimeValue runtime, String name, Class type, Object instance) { -runtime.getValue().getRegistry().bind(name, type, instance); +runtime.getValue().bind(name, type, instance); } public void bind( -RuntimeValue runtime, +RuntimeValue runtime, String name, Class type) { try { -runtime.getValue().getRegistry().bind(name, type, type.newInstance()); +runtime.getValue().bind(name, type, type.newInstance()); } catch (Exception e) { throw new RuntimeException(e); } } -public BeanContainerListener initRuntimeInjection(RuntimeValue runtime) { -
[GitHub] [camel-quarkus] davsclaus commented on a change in pull request #226: Use MainSupport as base for running Camel
davsclaus commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331356648 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelContext.java ## @@ -365,11 +388,12 @@ public AsyncProcessor createMulticast(Collection processors, Executor @SuppressWarnings("unchecked") protected T resolve(Class clazz, String type, String name, CamelContext context) { Review comment: What is this method used for? Can we add some javadoc, and the code that is disabled is it to be removed or not? Maybe add a TODO if this code needs revisit This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] davsclaus commented on a change in pull request #226: Use MainSupport as base for running Camel
davsclaus commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331355504 ## File path: extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelSupport.java ## @@ -56,4 +69,67 @@ public static boolean isPublic(ClassInfo ci) { .flatMap(CamelSupport::safeWalk) .filter(Files::isRegularFile); } + +public static Stream getRouteBuilderClasses(IndexView view) { +Set allKnownImplementors = new HashSet<>(); +allKnownImplementors.addAll( + view.getAllKnownImplementors(DotName.createSimple(RoutesBuilder.class.getName(; +allKnownImplementors.addAll( + view.getAllKnownSubclasses(DotName.createSimple(RouteBuilder.class.getName(; +allKnownImplementors.addAll( + view.getAllKnownSubclasses(DotName.createSimple(AdviceWithRouteBuilder.class.getName(; + +return allKnownImplementors +.stream() +.filter(CamelSupport::isConcrete) +.filter(CamelSupport::isPublic) +.map(ClassInfo::toString); +} + +public static Stream services(ApplicationArchivesBuildItem applicationArchivesBuildItem) { +return CamelSupport.resources(applicationArchivesBuildItem, CamelSupport.CAMEL_SERVICE_BASE_PATH) +.map(CamelSupport::services) +.flatMap(Collection::stream); +} + +public static List services(Path p) { Review comment: Should this be public method This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] davsclaus commented on a change in pull request #226: Use MainSupport as base for running Camel
davsclaus commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331355003 ## File path: extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelSupport.java ## @@ -56,4 +69,67 @@ public static boolean isPublic(ClassInfo ci) { .flatMap(CamelSupport::safeWalk) .filter(Files::isRegularFile); } + +public static Stream getRouteBuilderClasses(IndexView view) { +Set allKnownImplementors = new HashSet<>(); Review comment: I wonder if we may want to use a LinkedHashSet to have ordering of discovered classes This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel
lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331373271 ## File path: extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelSupport.java ## @@ -56,4 +69,67 @@ public static boolean isPublic(ClassInfo ci) { .flatMap(CamelSupport::safeWalk) .filter(Files::isRegularFile); } + +public static Stream getRouteBuilderClasses(IndexView view) { +Set allKnownImplementors = new HashSet<>(); Review comment: As far as I remember you can order things in spring-boot but we can assume that a routes that have an explicit order should take the precedence over any other ordering mechanics. Needs to be tested but we can also document that the preferred way of ordering routes is through the Camel's Ordered interface. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] davsclaus commented on a change in pull request #226: Use MainSupport as base for running Camel
davsclaus commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331370185 ## File path: extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelSupport.java ## @@ -56,4 +69,67 @@ public static boolean isPublic(ClassInfo ci) { .flatMap(CamelSupport::safeWalk) .filter(Files::isRegularFile); } + +public static Stream getRouteBuilderClasses(IndexView view) { +Set allKnownImplementors = new HashSet<>(); Review comment: Ah yeah this allows end users to control this if they have use-cases where this may matter. I dont recall if we in eg spring-boot discover of routes have any ordering too. But the Ordered is a good idea, we use it elsewhere in Camel too. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel
lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331379660 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelContext.java ## @@ -365,11 +388,12 @@ public AsyncProcessor createMulticast(Collection processors, Executor @SuppressWarnings("unchecked") protected T resolve(Class clazz, String type, String name, CamelContext context) { Review comment: done This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel
lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331379603 ## File path: extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelSupport.java ## @@ -56,4 +69,67 @@ public static boolean isPublic(ClassInfo ci) { .flatMap(CamelSupport::safeWalk) .filter(Files::isRegularFile); } + +public static Stream getRouteBuilderClasses(IndexView view) { +Set allKnownImplementors = new HashSet<>(); +allKnownImplementors.addAll( + view.getAllKnownImplementors(DotName.createSimple(RoutesBuilder.class.getName(; +allKnownImplementors.addAll( + view.getAllKnownSubclasses(DotName.createSimple(RouteBuilder.class.getName(; +allKnownImplementors.addAll( + view.getAllKnownSubclasses(DotName.createSimple(AdviceWithRouteBuilder.class.getName(; + +return allKnownImplementors +.stream() +.filter(CamelSupport::isConcrete) +.filter(CamelSupport::isPublic) +.map(ClassInfo::toString); +} + +public static Stream services(ApplicationArchivesBuildItem applicationArchivesBuildItem) { +return CamelSupport.resources(applicationArchivesBuildItem, CamelSupport.CAMEL_SERVICE_BASE_PATH) +.map(CamelSupport::services) +.flatMap(Collection::stream); +} + +public static List services(Path p) { Review comment: done This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel
lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331379356 ## File path: extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelSupport.java ## @@ -56,4 +69,67 @@ public static boolean isPublic(ClassInfo ci) { .flatMap(CamelSupport::safeWalk) .filter(Files::isRegularFile); } + +public static Stream getRouteBuilderClasses(IndexView view) { +Set allKnownImplementors = new HashSet<>(); Review comment: https://issues.apache.org/jira/browse/CAMEL-14031 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel
lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331369013 ## File path: extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelSupport.java ## @@ -56,4 +69,67 @@ public static boolean isPublic(ClassInfo ci) { .flatMap(CamelSupport::safeWalk) .filter(Files::isRegularFile); } + +public static Stream getRouteBuilderClasses(IndexView view) { +Set allKnownImplementors = new HashSet<>(); Review comment: The problem is that the order also depends on how Jandex indexes entries so I'm not sure if it matter, maybe better is to have the RouteBuilder extends the Ordered interface and order them when routes are processed ? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
Re: ApacheCon North America 2020, project participation
Hi Rich and the Planners, I would be happy to participate in organizing the integration or Apache Camel track for the next ApacheCon. I would suggest that the same principle is applied to the rest of the conferences ASF endorses, not just to the ApacheCon NA. zoran On Tue, Oct 1, 2019 at 6:35 PM Rich Bowen wrote: > > Hi, folks, > > (Note: You're receiving this email because you're on the dev@ list for > one or more Apache Software Foundation projects.) > > For ApacheCon North America 2019, we asked projects to participate in > the creation of project/topic specific tracks. This was very successful, > with about 15 projects stepping up to curate the content for their > track/summit/event. > > We need to know if you're going to do the same for 2020. This informs > how large a venue we book for the event, how long the event runs, and > many other considerations. > > If you intend to participate again in 2020, we need to hear from you on > the plann...@apachecon.com mailing list. This is not a firm commitment, > but we need to know if you're, say, 75% confident that you'll be > participating. > > And, no, we do not have any details at all, but assume that it will be > in roughly the same calendar space as this year's event, ie, somewhere > in the August-October timeframe. > > Thanks. > > -- > Rich Bowen > VP Conferences > The Apache Software Foundation > @apachecon -- Zoran Regvart
[GitHub] [camel-quarkus] lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel
lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331734008 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelConfig.java ## @@ -55,6 +47,21 @@ */ @ConfigItem(defaultValue = "false") public boolean disableXml; + +/** + * Disable camel-main. + * When main is disabled, routes won't be automatically be loaded and + * started and the entire lifecycle of the Camel Context is under user + * control. + */ +@ConfigItem(defaultValue = "false") +public boolean disableMain; Review comment: It uses negation to be consistent with other properties This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel
lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331734010 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/Flags.java ## @@ -38,4 +38,10 @@ public boolean getAsBoolean() { } } +public static final class MainDisabled implements BooleanSupplier { Review comment: Same as above This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331701127 ## File path: integration-tests/bean/pom.xml ## @@ -30,6 +30,10 @@ Integration tests for Camel Bean extension + +org.apache.camel.quarkus +camel-quarkus-core Review comment: Core is redundant here, isn't it? And similarly in other itests. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331696222 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelConfig.java ## @@ -55,6 +47,21 @@ */ @ConfigItem(defaultValue = "false") public boolean disableXml; + +/** + * Disable camel-main. + * When main is disabled, routes won't be automatically be loaded and + * started and the entire lifecycle of the Camel Context is under user + * control. + */ +@ConfigItem(defaultValue = "false") +public boolean disableMain; Review comment: I'd generally vote for using non-negated names, e.g. `mainEnabled` in this case. I find them easier to decipher, esp. when used with a negator. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331699753 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/Flags.java ## @@ -38,4 +38,10 @@ public boolean getAsBoolean() { } } +public static final class MainDisabled implements BooleanSupplier { Review comment: This could eventually also get un-negated. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331700451 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/RuntimeBeanRepository.java ## @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.core; + +import java.util.Map; +import java.util.Set; + +import org.apache.camel.spi.BeanRepository; + +public final class RuntimeBeanRepository implements BeanRepository { Review comment: RuntimeBeanRepository being the only caller of BeanManagerHelper, is there a reason to keep them separate? I mean the invocations of BeanManagerHelper could be inlined here. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] asf-ci commented on issue #226: Use MainSupport as base for running Camel
asf-ci commented on issue #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#issuecomment-538581813 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/camel-quarkus-pr/200/ This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] asf-ci commented on issue #226: Use MainSupport as base for running Camel
asf-ci commented on issue #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#issuecomment-538600945 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/camel-quarkus-pr/201/ This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331420264 ## File path: extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/BuildProcessor.java ## @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.main.deployment; + +import java.util.List; + +import io.quarkus.arc.deployment.AdditionalBeanBuildItem; +import io.quarkus.arc.deployment.BeanContainerBuildItem; +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.annotations.ExecutionTime; +import io.quarkus.deployment.annotations.Record; +import io.quarkus.deployment.builditem.CombinedIndexBuildItem; +import io.quarkus.deployment.builditem.ServiceStartBuildItem; +import io.quarkus.deployment.builditem.ShutdownContextBuildItem; +import io.quarkus.runtime.RuntimeValue; +import org.apache.camel.quarkus.core.deployment.CamelContextBuildItem; +import org.apache.camel.quarkus.core.deployment.CamelSupport; +import org.apache.camel.quarkus.main.CamelMain; +import org.apache.camel.quarkus.main.CamelMainProducers; +import org.apache.camel.quarkus.main.CamelMainRecorder; +import org.apache.camel.quarkus.main.deployment.support.CamelMainBuildItem; +import org.apache.camel.quarkus.main.deployment.support.CamelMainListenerBuildItem; + +public class BuildProcessor { +@BuildStep +void beans(BuildProducer beanProducer) { + beanProducer.produce(AdditionalBeanBuildItem.unremovableOf(CamelMainProducers.class)); +} + +@Record(ExecutionTime.STATIC_INIT) +@BuildStep +CamelMainBuildItem create( +CombinedIndexBuildItem combinedIndexBuildItem, +CamelMainRecorder recorder, +CamelContextBuildItem context, +List listeners, +// TODO: keep is as it adds a dependency on Arc Review comment: It would be nice to document why is the dependency on Arc important, e.g. to be able to decide in the future that the param is not needed anymore. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331416255 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRecorder.java ## @@ -16,88 +16,98 @@ */ package org.apache.camel.quarkus.core.runtime; -import io.quarkus.arc.runtime.BeanContainerListener; +import java.util.function.Supplier; + +import io.quarkus.arc.runtime.BeanContainer; import io.quarkus.runtime.RuntimeValue; -import io.quarkus.runtime.ShutdownContext; import io.quarkus.runtime.annotations.Recorder; -import org.apache.camel.RoutesBuilder; -import org.apache.camel.quarkus.core.runtime.support.FastCamelRuntime; +import org.apache.camel.CamelContext; +import org.apache.camel.ExtendedCamelContext; +import org.apache.camel.RuntimeCamelException; +import org.apache.camel.quarkus.core.runtime.support.FastCamelContext; +import org.apache.camel.quarkus.core.runtime.support.FastModel; +import org.apache.camel.quarkus.core.runtime.support.RuntimeRegistry; import org.apache.camel.spi.Registry; +import org.graalvm.nativeimage.ImageInfo; @Recorder public class CamelRecorder { -public RuntimeValue create(Registry registry) { - -FastCamelRuntime fcr = new FastCamelRuntime(); -fcr.setRegistry(registry); - -return new RuntimeValue<>(fcr); -} - -public void init( -RuntimeValue runtime, -CamelConfig.BuildTime buildTimeConfig) { - -FastCamelRuntime fcr = (FastCamelRuntime) runtime.getValue(); -fcr.init(buildTimeConfig); +public RuntimeValue createRegistry() { +return new RuntimeValue<>(new RuntimeRegistry()); } -public void start( -ShutdownContext shutdown, -RuntimeValue runtime, -CamelConfig.Runtime runtimeConfig) throws Exception { +@SuppressWarnings("unchecked") +public RuntimeValue createContext(RuntimeValue registry, BeanContainer beanContainer, CamelConfig.BuildTime buildTimeConfig) { +FastCamelContext context = new FastCamelContext(); +context.setRegistry(registry.getValue()); +context.setLoadTypeConverters(false); +context.getTypeConverterRegistry().setInjector(context.getInjector()); -runtime.getValue().start(runtimeConfig); - -//in development mode undertow is started eagerly -shutdown.addShutdownTask(new Runnable() { -@Override -public void run() { -try { -runtime.getValue().stop(); -} catch (Exception e) { -throw new RuntimeException(e); +try { +if (buildTimeConfig.disableJaxb) { + context.adapt(ExtendedCamelContext.class).setModelJAXBContextFactory(() -> { +throw new UnsupportedOperationException(); +}); +} else { +// The creation of the JAXB context is very time consuming, so always prepare it +// when running in native mode, but lazy create it in java mode so that we don't +// waste time if using java routes +if (ImageInfo.inImageBuildtimeCode()) { + context.adapt(ExtendedCamelContext.class).getModelJAXBContextFactory().newJAXBContext(); } } -}); -} +} catch (Exception e) { +throw RuntimeCamelException.wrapRuntimeCamelException(e); +} -public void addBuilder( -RuntimeValue runtime, -String className) { +FastModel model = new FastModel(context); -FastCamelRuntime fcr = (FastCamelRuntime) runtime.getValue(); +context.setModel(model); +context.init(); -try { -fcr.getBuilders().add((RoutesBuilder) Class.forName(className).newInstance()); -} catch (Exception e) { -throw new RuntimeException(e); -} +// register to the container +beanContainer.instance(CamelProducers.class).setContext(context); + +return new RuntimeValue<>(context); } public void bind( -RuntimeValue runtime, +RuntimeValue runtime, String name, Class type, Object instance) { -runtime.getValue().getRegistry().bind(name, type, instance); +runtime.getValue().bind(name, type, instance); } public void bind( -RuntimeValue runtime, +RuntimeValue runtime, String name, Class type) { try { -runtime.getValue().getRegistry().bind(name, type, type.newInstance()); +runtime.getValue().bind(name, type, type.newInstance()); } catch (Exception e) { throw new RuntimeException(e); } } -public BeanContainerListener initRuntimeInjection(RuntimeValue runtime) { -
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331400596 ## File path: extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelSupport.java ## @@ -56,4 +69,67 @@ public static boolean isPublic(ClassInfo ci) { .flatMap(CamelSupport::safeWalk) .filter(Files::isRegularFile); } + +public static Stream getRouteBuilderClasses(IndexView view) { +Set allKnownImplementors = new HashSet<>(); Review comment: +1 For deterministic ordering that makes issues reproducible. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331404413 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelProducers.java ## @@ -16,51 +16,41 @@ */ package org.apache.camel.quarkus.core.runtime; -import javax.enterprise.context.ApplicationScoped; import javax.enterprise.inject.Produces; +import javax.inject.Singleton; import org.apache.camel.CamelContext; import org.apache.camel.ConsumerTemplate; import org.apache.camel.ProducerTemplate; import org.apache.camel.spi.Registry; -@ApplicationScoped +@Singleton public class CamelProducers { +private CamelContext context; Review comment: IRC, CDI does not care for synchronization in any way. Shouldn't this be `volatile`? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331423929 ## File path: extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/support/CamelMainBuildItem.java ## @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.main.deployment.support; + +import io.quarkus.builder.item.SimpleBuildItem; +import io.quarkus.runtime.RuntimeValue; +import org.apache.camel.quarkus.main.CamelMain; + +public final class CamelMainBuildItem extends SimpleBuildItem { Review comment: Minor: Do these two BuildItem classes deserve a separate package (with a meaningless `support` last segment name?) This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331360854 ## File path: extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/BuildProcessor.java ## @@ -67,151 +47,57 @@ @Record(ExecutionTime.STATIC_INIT) @BuildStep -CamelRuntimeBuildItem create( +CamelRegistryBuildItem registry( Review comment: +1 for having a separate RegistryBuildItem This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331395515 ## File path: extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelContextBuildItem.java ## @@ -16,19 +16,19 @@ */ package org.apache.camel.quarkus.core.deployment; + import io.quarkus.builder.item.SimpleBuildItem; import io.quarkus.runtime.RuntimeValue; -import org.apache.camel.quarkus.core.runtime.CamelRuntime; - -public final class CamelRuntimeBuildItem extends SimpleBuildItem { +import org.apache.camel.CamelContext; -private final RuntimeValue runtime; +public final class CamelContextBuildItem extends SimpleBuildItem { Review comment: ```suggestion /** * Holds the {@link CamelContext} {@link RuntimeValue}. */ public final class CamelContextBuildItem extends SimpleBuildItem { ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331416414 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRecorder.java ## @@ -16,88 +16,98 @@ */ package org.apache.camel.quarkus.core.runtime; -import io.quarkus.arc.runtime.BeanContainerListener; +import java.util.function.Supplier; + +import io.quarkus.arc.runtime.BeanContainer; import io.quarkus.runtime.RuntimeValue; -import io.quarkus.runtime.ShutdownContext; import io.quarkus.runtime.annotations.Recorder; -import org.apache.camel.RoutesBuilder; -import org.apache.camel.quarkus.core.runtime.support.FastCamelRuntime; +import org.apache.camel.CamelContext; +import org.apache.camel.ExtendedCamelContext; +import org.apache.camel.RuntimeCamelException; +import org.apache.camel.quarkus.core.runtime.support.FastCamelContext; +import org.apache.camel.quarkus.core.runtime.support.FastModel; +import org.apache.camel.quarkus.core.runtime.support.RuntimeRegistry; import org.apache.camel.spi.Registry; +import org.graalvm.nativeimage.ImageInfo; @Recorder public class CamelRecorder { -public RuntimeValue create(Registry registry) { - -FastCamelRuntime fcr = new FastCamelRuntime(); -fcr.setRegistry(registry); - -return new RuntimeValue<>(fcr); -} - -public void init( -RuntimeValue runtime, -CamelConfig.BuildTime buildTimeConfig) { - -FastCamelRuntime fcr = (FastCamelRuntime) runtime.getValue(); -fcr.init(buildTimeConfig); +public RuntimeValue createRegistry() { +return new RuntimeValue<>(new RuntimeRegistry()); } -public void start( -ShutdownContext shutdown, -RuntimeValue runtime, -CamelConfig.Runtime runtimeConfig) throws Exception { +@SuppressWarnings("unchecked") +public RuntimeValue createContext(RuntimeValue registry, BeanContainer beanContainer, CamelConfig.BuildTime buildTimeConfig) { +FastCamelContext context = new FastCamelContext(); +context.setRegistry(registry.getValue()); +context.setLoadTypeConverters(false); +context.getTypeConverterRegistry().setInjector(context.getInjector()); -runtime.getValue().start(runtimeConfig); - -//in development mode undertow is started eagerly -shutdown.addShutdownTask(new Runnable() { -@Override -public void run() { -try { -runtime.getValue().stop(); -} catch (Exception e) { -throw new RuntimeException(e); +try { +if (buildTimeConfig.disableJaxb) { + context.adapt(ExtendedCamelContext.class).setModelJAXBContextFactory(() -> { +throw new UnsupportedOperationException(); +}); +} else { +// The creation of the JAXB context is very time consuming, so always prepare it +// when running in native mode, but lazy create it in java mode so that we don't +// waste time if using java routes +if (ImageInfo.inImageBuildtimeCode()) { + context.adapt(ExtendedCamelContext.class).getModelJAXBContextFactory().newJAXBContext(); } } -}); -} +} catch (Exception e) { +throw RuntimeCamelException.wrapRuntimeCamelException(e); +} -public void addBuilder( -RuntimeValue runtime, -String className) { +FastModel model = new FastModel(context); -FastCamelRuntime fcr = (FastCamelRuntime) runtime.getValue(); +context.setModel(model); +context.init(); -try { -fcr.getBuilders().add((RoutesBuilder) Class.forName(className).newInstance()); -} catch (Exception e) { -throw new RuntimeException(e); -} +// register to the container +beanContainer.instance(CamelProducers.class).setContext(context); + +return new RuntimeValue<>(context); } public void bind( -RuntimeValue runtime, +RuntimeValue runtime, String name, Class type, Object instance) { -runtime.getValue().getRegistry().bind(name, type, instance); +runtime.getValue().bind(name, type, instance); } public void bind( -RuntimeValue runtime, +RuntimeValue runtime, String name, Class type) { try { -runtime.getValue().getRegistry().bind(name, type, type.newInstance()); +runtime.getValue().bind(name, type, type.newInstance()); } catch (Exception e) { throw new RuntimeException(e); } } -public BeanContainerListener initRuntimeInjection(RuntimeValue runtime) { -
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331424710 ## File path: extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainEventDispatcher.java ## @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.main; + +import io.quarkus.arc.Arc; +import org.apache.camel.CamelContext; +import org.apache.camel.main.MainSupport; + +public class CamelMainEventDispatcher implements org.apache.camel.main.MainListener { Review comment: Please a single sentence summary JavaDoc what is this class doing. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331418081 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/BeanManagerHelper.java ## @@ -27,6 +27,7 @@ import javax.enterprise.inject.spi.BeanManager; import io.quarkus.arc.Arc; +import io.quarkus.arc.ArcContainer; @Vetoed Review comment: ```suggestion /** * Helper methods to map {@link Registry} calls to {@link Arc}. */ @Vetoed ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331400183 ## File path: extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelSupport.java ## @@ -18,13 +18,26 @@ import java.io.IOError; import java.io.IOException; +import java.io.InputStream; import java.lang.reflect.Modifier; import java.nio.file.Files; import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; import java.util.stream.Stream; import io.quarkus.deployment.builditem.ApplicationArchivesBuildItem; +import org.apache.camel.RoutesBuilder; +import org.apache.camel.builder.AdviceWithRouteBuilder; +import org.apache.camel.builder.RouteBuilder; import org.jboss.jandex.ClassInfo; +import org.jboss.jandex.DotName; +import org.jboss.jandex.IndexView; public final class CamelSupport { Review comment: A minimal JavaDoc stating the purpose of this class would be nice. If the public methods are supposed to be usable by other extensions, they should get a minimal JavaDoc too. Those ones not supposed to be publicly usable should not be public (but a single sentence describing the contract and behavior would still be nice, although it is much less important for private and package-visible methods). This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331421875 ## File path: extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/SubstrateProcessor.java ## @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.main.deployment; + +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.CombinedIndexBuildItem; +import io.quarkus.deployment.builditem.substrate.ReflectiveClassBuildItem; +import org.apache.camel.quarkus.core.deployment.CamelSupport; +import org.jboss.jandex.IndexView; + +public class SubstrateProcessor { Review comment: Why do we need two Processors? It would be nice to figure out from JavaDoc which tasks belong where. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331415449 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRecorder.java ## @@ -16,88 +16,98 @@ */ package org.apache.camel.quarkus.core.runtime; -import io.quarkus.arc.runtime.BeanContainerListener; +import java.util.function.Supplier; + +import io.quarkus.arc.runtime.BeanContainer; import io.quarkus.runtime.RuntimeValue; -import io.quarkus.runtime.ShutdownContext; import io.quarkus.runtime.annotations.Recorder; -import org.apache.camel.RoutesBuilder; -import org.apache.camel.quarkus.core.runtime.support.FastCamelRuntime; +import org.apache.camel.CamelContext; +import org.apache.camel.ExtendedCamelContext; +import org.apache.camel.RuntimeCamelException; +import org.apache.camel.quarkus.core.runtime.support.FastCamelContext; +import org.apache.camel.quarkus.core.runtime.support.FastModel; +import org.apache.camel.quarkus.core.runtime.support.RuntimeRegistry; import org.apache.camel.spi.Registry; +import org.graalvm.nativeimage.ImageInfo; @Recorder public class CamelRecorder { -public RuntimeValue create(Registry registry) { - -FastCamelRuntime fcr = new FastCamelRuntime(); -fcr.setRegistry(registry); - -return new RuntimeValue<>(fcr); -} - -public void init( -RuntimeValue runtime, -CamelConfig.BuildTime buildTimeConfig) { - -FastCamelRuntime fcr = (FastCamelRuntime) runtime.getValue(); -fcr.init(buildTimeConfig); +public RuntimeValue createRegistry() { +return new RuntimeValue<>(new RuntimeRegistry()); } -public void start( -ShutdownContext shutdown, -RuntimeValue runtime, -CamelConfig.Runtime runtimeConfig) throws Exception { +@SuppressWarnings("unchecked") +public RuntimeValue createContext(RuntimeValue registry, BeanContainer beanContainer, CamelConfig.BuildTime buildTimeConfig) { Review comment: A JavaDoc stating whether this is a invoked from a build time or a runtime BuildStep would be nice. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331396732 ## File path: extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRegistryBuildItem.java ## @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.core.deployment; + +import io.quarkus.builder.item.SimpleBuildItem; +import io.quarkus.runtime.RuntimeValue; +import org.apache.camel.spi.Registry; + +public final class CamelRegistryBuildItem extends SimpleBuildItem { Review comment: ```suggestion /** * Holds the {@link Registry} {@link RuntimeValue}. */ public final class CamelRegistryBuildItem extends SimpleBuildItem { ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331444759 ## File path: extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/CustomDefaultServletClassTest.java ## @@ -30,25 +37,45 @@ @RegisterExtension static final QuarkusUnitTest CONFIG = new QuarkusUnitTest() .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) -.addClasses(Routes.class) -.addAsResource(new StringAsset( -"quarkus.camel.servlet.url-patterns=/*\n" -+ "quarkus.camel.servlet.servlet-name=my-named-servlet\n" -+ "quarkus.camel.servlet.servlet-class=" + CustomServlet.class.getName() + "\n"), -"application.properties")); +.addAsResource(applicationProperties(), "application.properties")); @Test -public void customDefaultServletClass() { -RestAssured.when().get("/custom").then() -.body(IsEqual.equalTo("GET: /custom")) -.and().header("x-servlet-class-name", CustomServlet.class.getName()); +public void customDefaultServletClass() throws Exception { +DefaultCamelContext context = new DefaultCamelContext(); +context.addRoutes(new Routes()); +context.start(); Review comment: Why do we have to do this manually now? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331430871 ## File path: extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainEvents.java ## @@ -14,8 +14,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.quarkus.core.runtime; +package org.apache.camel.quarkus.main; -public class InitializingEvent { +public final class CamelMainEvents { Review comment: Each of this events should be documented: * Who is firing it? * Start/Stop of what? * Any other the users should know? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331451470 ## File path: integration-tests/pom.xml ## @@ -80,7 +80,8 @@ core core-impl -core-cdi + Review comment: This commented line can perhaps be removed? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331428228 ## File path: extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/support/CamelMainListenerBuildItem.java ## @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.main.deployment.support; + +import io.quarkus.builder.item.MultiBuildItem; +import org.apache.camel.main.MainListener; + +public final class CamelMainListenerBuildItem extends MultiBuildItem { Review comment: ```suggestion /** * A {@link MultiBuildItem} holding {@link MainListener}s to add to {@link CamelMain}. */ public final class CamelMainListenerBuildItem extends MultiBuildItem { ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331431979 ## File path: extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java ## @@ -0,0 +1,84 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.main; + +import java.util.function.Supplier; + +import io.quarkus.arc.runtime.BeanContainer; +import io.quarkus.runtime.RuntimeValue; +import io.quarkus.runtime.ShutdownContext; +import io.quarkus.runtime.annotations.Recorder; +import org.apache.camel.CamelContext; +import org.apache.camel.main.MainListener; + +@Recorder +public class CamelMainRecorder { +public RuntimeValue create(RuntimeValue runtime, BeanContainer container) { Review comment: I vote for renaming to `createCamelMain` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331441711 ## File path: extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java ## @@ -0,0 +1,84 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.main; + +import java.util.function.Supplier; + +import io.quarkus.arc.runtime.BeanContainer; +import io.quarkus.runtime.RuntimeValue; +import io.quarkus.runtime.ShutdownContext; +import io.quarkus.runtime.annotations.Recorder; +import org.apache.camel.CamelContext; +import org.apache.camel.main.MainListener; + +@Recorder +public class CamelMainRecorder { +public RuntimeValue create(RuntimeValue runtime, BeanContainer container) { +CamelMain main = new CamelMain(); +main.setCamelContext(runtime.getValue()); +main.disableHangupSupport(); +main.addMainListener(new CamelMainEventDispatcher()); + +// register to the container +container.instance(CamelMainProducers.class).setMain(main); + +return new RuntimeValue<>(main); +} + +public void addRouteBuilder( +RuntimeValue main, +String className) { +try { +main.getValue().addRouteBuilder(Class.forName(className)); +} catch (Exception e) { +throw new RuntimeException(e); Review comment: ```suggestion throw new RuntimeException("Could not add route builder '" + className + "'", e); ``` Might produce a more useful message in case there is a problem with a specific route builder out of many. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331430098 ## File path: extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainEvents.java ## @@ -14,8 +14,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.quarkus.core.runtime; +package org.apache.camel.quarkus.main; -public class InitializingEvent { +public final class CamelMainEvents { +private CamelMainEvents() { +} +public static class BeforeStart { +} + +public static class Configure { +} + +public static class AsfterStart { +} + +public static class BeforeStop { +} + +public static class AsfterStop { Review comment: `s/AsfterStop/AfterStop/` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331446991 ## File path: integration-tests/aws/pom.xml ## @@ -30,6 +30,10 @@ The camel integration tests + +org.apache.camel.quarkus +camel-quarkus-main + Review comment: Do we really want end users to have to depend on `camel-quarkus-main` directly in addition to the endpoint extensions they want to use? It spontaneously looks like an unnecessary complication to me. Shouldn't our endpoint extensions better depend on `camel-quarkus-main`? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331442901 ## File path: extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java ## @@ -0,0 +1,84 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.main; + +import java.util.function.Supplier; + +import io.quarkus.arc.runtime.BeanContainer; +import io.quarkus.runtime.RuntimeValue; +import io.quarkus.runtime.ShutdownContext; +import io.quarkus.runtime.annotations.Recorder; +import org.apache.camel.CamelContext; +import org.apache.camel.main.MainListener; + +@Recorder +public class CamelMainRecorder { +public RuntimeValue create(RuntimeValue runtime, BeanContainer container) { +CamelMain main = new CamelMain(); +main.setCamelContext(runtime.getValue()); +main.disableHangupSupport(); +main.addMainListener(new CamelMainEventDispatcher()); + +// register to the container +container.instance(CamelMainProducers.class).setMain(main); + +return new RuntimeValue<>(main); +} + +public void addRouteBuilder( +RuntimeValue main, +String className) { +try { +main.getValue().addRouteBuilder(Class.forName(className)); +} catch (Exception e) { +throw new RuntimeException(e); +} +} + +public void addListener(RuntimeValue main, MainListener listener) { +main.getValue().addMainListener(listener); +} + +public void start(ShutdownContext shutdown, RuntimeValue main) { +shutdown.addShutdownTask(new Runnable() { +@Override +public void run() { +try { +main.getValue().stop(); +} catch (Exception e) { +throw new RuntimeException(e); +} +} +}); + +try { +main.getValue().init(); +main.getValue().start(); +} catch (Exception e) { +throw new RuntimeException(e); +} +} + +public Supplier mainSupplier(RuntimeValue main) { Review comment: What is the purpose of this method? I do not see it used anywhere. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331429745 ## File path: integration-tests/main/runtime/src/main/java/org/apache/camel/quarkus/main/support/SupportRecorder.java ## @@ -14,8 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.quarkus.core.runtime; +package org.apache.camel.quarkus.main.support; -public class StartingEvent { +import io.quarkus.runtime.annotations.Recorder; +@Recorder +public class SupportRecorder { Review comment: It looks like this class can be removed? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331431429 ## File path: extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainProducers.java ## @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.main; + +import javax.enterprise.inject.Produces; +import javax.inject.Singleton; + +@Singleton +public class CamelMainProducers { +private CamelMain main; Review comment: `volatile` maybe? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-k] nicolaferraro commented on issue #982: Operator fails on minikube
nicolaferraro commented on issue #982: Operator fails on minikube URL: https://github.com/apache/camel-k/issues/982#issuecomment-538355127 Yeah, maybe we can embed that in the scripts for only when doing `make mages`. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-k] jacobborella commented on issue #982: Operator fails on minikube
jacobborella commented on issue #982: Operator fails on minikube URL: https://github.com/apache/camel-k/issues/982#issuecomment-538356955 Thx for the quick reply. It makes sense - and yes, I'm on a mac. If I execute `GOOS=linux make images` the build fails though. I'm reading through the cross compilation section of the go manual and I see that I also have to provide GOARCH=amd64. The build still fails though `env GOOS=linux GOARCH=amd64 make images` give $ env GOOS=linux GOARCH=amd64 make images go build -ldflags "-X github.com/apache/camel-k/pkg/cmd/operator.GitCommit=6f0da195533b1b848388493a0529d11db54855ad" -gcflags=-trimpath=/Users/jacobborella/go -asmflags=-trimpath=/Users/jacobborella/go -o kamel ./cmd/kamel/*.go go test -c -tags="integration knative" ./e2e/*.go go test ./... ?github.com/apache/camel-k/cmd/kamel [no test files] ?github.com/apache/camel-k/cmd/util/json-schema-gen [no test files] ?github.com/apache/camel-k/deploy[no test files] ?github.com/apache/camel-k/pkg/apis [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b718/v1alpha1.test: exec format error FAIL github.com/apache/camel-k/pkg/apis/camel/v1alpha1 0.007s ?github.com/apache/camel-k/pkg/apis/camel/v1alpha1/knative [no test files] ?github.com/apache/camel-k/pkg/apis/knative08compat [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b722/builder.test: exec format error FAIL github.com/apache/camel-k/pkg/builder 0.010s ?github.com/apache/camel-k/pkg/builder/kaniko[no test files] ?github.com/apache/camel-k/pkg/builder/s2i [no test files] ?github.com/apache/camel-k/pkg/client[no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b725/cmd.test: exec format error FAIL github.com/apache/camel-k/pkg/cmd 0.015s ?github.com/apache/camel-k/pkg/cmd/builder [no test files] ?github.com/apache/camel-k/pkg/cmd/operator [no test files] ?github.com/apache/camel-k/pkg/controller[no test files] ?github.com/apache/camel-k/pkg/controller/build [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b728/integration.test: exec format error FAIL github.com/apache/camel-k/pkg/controller/integration0.009s ?github.com/apache/camel-k/pkg/controller/integrationkit [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b731/integrationplatform.test: exec format error FAIL github.com/apache/camel-k/pkg/controller/integrationplatform0.026s fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b734/gzip.test: exec format error FAIL github.com/apache/camel-k/pkg/gzip 0.006s ?github.com/apache/camel-k/pkg/install [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b737/metadata.test: exec format error FAIL github.com/apache/camel-k/pkg/metadata 0.006s ?github.com/apache/camel-k/pkg/platform [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b740/trait.test: exec format error FAIL github.com/apache/camel-k/pkg/trait 0.005s ?github.com/apache/camel-k/pkg/util [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b743/camel.test: exec format error FAIL github.com/apache/camel-k/pkg/util/camel0.011s ?github.com/apache/camel-k/pkg/util/cancellable [no test files] ?github.com/apache/camel-k/pkg/util/defaults [no test files] ?github.com/apache/camel-k/pkg/util/digest [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b746/envvar.test: exec format error FAIL github.com/apache/camel-k/pkg/util/envvar 0.007s ?github.com/apache/camel-k/pkg/util/finalizer[no test files] ?github.com/apache/camel-k/pkg/util/indentedwriter [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b749/knative.test: exec format error FAIL github.com/apache/camel-k/pkg/util/knative 0.005s fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b752/kubernetes.test: exec format error FAIL github.com/apache/camel-k/pkg/util/kubernetes 0.005s ?github.com/apache/camel-k/pkg/util/kubernetes/customclient [no test files] ?github.com/apache/camel-k/pkg/util/kubernetes/log [no test files] ?github.com/apache/camel-k/pkg/util/log [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b755/maven.test: exec format error FAIL
[GitHub] [camel-k] jacobborella edited a comment on issue #982: Build operator image from non-Linux local OS
jacobborella edited a comment on issue #982: Build operator image from non-Linux local OS URL: https://github.com/apache/camel-k/issues/982#issuecomment-538365139 I did the following make clean make cp kamel /usr/local/bin/kamel make images GOOS=linux make build-kamel cp kamel build/_output/bin/ operator-sdk build docker.io/apache/camel-k:1.0.0-M2-SNAPSHOT kamel install and then it worked. Thanks a lot for your help. I'll now get started getting more acquainted with the project. Let me know if there's anything specific you would like me to look at. Otherwise I'll probably look if I can fix any of the open issues. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331467894 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/BeanManagerHelper.java ## @@ -27,25 +27,35 @@ import javax.enterprise.inject.spi.BeanManager; import io.quarkus.arc.Arc; +import io.quarkus.arc.ArcContainer; +/** + * Helper methods retrieve beans from the {@link Arc} container. Review comment: ... methods _to_ retrieve ... maybe? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-k] astefanutti commented on issue #982: Build operator image from non-Linux local OS
astefanutti commented on issue #982: Build operator image from non-Linux local OS URL: https://github.com/apache/camel-k/issues/982#issuecomment-538370096 @jacobborella happy to have you on the project. You can start with the issues labelled as _easy fix_. Otherwise, I think #751 or #665 could be interesting candidates to get hands-on into the project. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-k] jacobborella edited a comment on issue #982: Build operator image from non-Linux local OS
jacobborella edited a comment on issue #982: Build operator image from non-Linux local OS URL: https://github.com/apache/camel-k/issues/982#issuecomment-538365139 I did the following make clean make cp kamel /usr/local/bin/kamel make images env GOOS=linux GOARCH=amd64 make build-kamel cp kamel build/_output/bin/ operator-sdk build docker.io/apache/camel-k:1.0.0-M2-SNAPSHOT kamel install and then it worked. Thanks a lot for your help. I'll now get started getting more acquainted with the project. Let me know if there's anything specific you would like me to look at. Otherwise I'll probably look if I can fix any of the open issues. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel
lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331473156 ## File path: extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/SubstrateProcessor.java ## @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.main.deployment; + +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.CombinedIndexBuildItem; +import io.quarkus.deployment.builditem.substrate.ReflectiveClassBuildItem; +import org.apache.camel.quarkus.core.deployment.CamelSupport; +import org.jboss.jandex.IndexView; + +public class SubstrateProcessor { Review comment: `SubstrateProcessor` is meant to contains build steps related to substrate like reflection, substrate properties and so on. The distinction is juts logical so one know where to look depending of the context. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-k] astefanutti commented on issue #982: Operator fails on minikube
astefanutti commented on issue #982: Operator fails on minikube URL: https://github.com/apache/camel-k/issues/982#issuecomment-538358775 Ah, it's too wide so the test binaries target the Linux OS too. We're going to fix it as suggested by @nicolaferraro. In the meatime, you can do: ``` GOOS=linux make build-kamel cp kamel build/_output/bin/ operator-sdk build docker.io/apache/camel-k:1.0.0-M2-SNAPSHOT ``` To build the image locally for Linux. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331463020 ## File path: extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/SubstrateProcessor.java ## @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.main.deployment; + +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.CombinedIndexBuildItem; +import io.quarkus.deployment.builditem.substrate.ReflectiveClassBuildItem; +import org.apache.camel.quarkus.core.deployment.CamelSupport; +import org.jboss.jandex.IndexView; + +public class SubstrateProcessor { Review comment: There is `org.apache.camel.quarkus.main.deployment.BuildProcessor` and `org.apache.camel.quarkus.main.deployment.SubstrateProcessor`. Both contain build steps and it is not clear to me what would be the criteria to decide for the current and future build steps into which one they belong? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on issue #226: Use MainSupport as base for running Camel
lburgazzoli commented on issue #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#issuecomment-538378764 @ppalaga findings fixed (I hope) This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331483543 ## File path: integration-tests/aws/pom.xml ## @@ -30,6 +30,10 @@ The camel integration tests + +org.apache.camel.quarkus +camel-quarkus-main + Review comment: What are the potential use cases for creating one's own "mains"? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331500021 ## File path: integration-tests/aws/pom.xml ## @@ -30,6 +30,10 @@ The camel integration tests + +org.apache.camel.quarkus +camel-quarkus-main + Review comment: Do you need this in Camel K? Do you think 80+% of Camel Quarkus users will need this? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331503343 ## File path: integration-tests/aws/pom.xml ## @@ -30,6 +30,10 @@ The camel integration tests + +org.apache.camel.quarkus +camel-quarkus-main + Review comment: I am trying to understand the significance of this. In case this is meant to be a speciality for <20% of users, then I think we should figure out how not confuse the rest 80% of the users. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-k] jacobborella commented on issue #982: Build operator image from non-Linux local OS
jacobborella commented on issue #982: Build operator image from non-Linux local OS URL: https://github.com/apache/camel-k/issues/982#issuecomment-538365139 I did the following make clean make cp kamel /usr/local/bin/kamel make images GOOS=linux make build-kamel cp kamel build/_output/bin/ operator-sdk build docker.io/apache/camel-k:1.0.0-M2-SNAPSHOT kamel install and then it worked. Thanks a lot for your help. I'll now get started getting more acquainted with the project. Let me know if there's anything specific you would like med to look at. Otherwise I'll probably look if I can fix any of the open issues. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331463020 ## File path: extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/SubstrateProcessor.java ## @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.main.deployment; + +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.CombinedIndexBuildItem; +import io.quarkus.deployment.builditem.substrate.ReflectiveClassBuildItem; +import org.apache.camel.quarkus.core.deployment.CamelSupport; +import org.jboss.jandex.IndexView; + +public class SubstrateProcessor { Review comment: There is `org.apache.camel.quarkus.main.deployment.BuildProcessor` and `org.apache.camel.quarkus.main.deployment.SubstrateProcessor`. Both contain build steps and it is not clear to me what would be the criteria to decide for the current and future build steps to decide into which one they belong? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331464787 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRecorder.java ## @@ -16,88 +16,98 @@ */ package org.apache.camel.quarkus.core.runtime; -import io.quarkus.arc.runtime.BeanContainerListener; +import java.util.function.Supplier; + +import io.quarkus.arc.runtime.BeanContainer; import io.quarkus.runtime.RuntimeValue; -import io.quarkus.runtime.ShutdownContext; import io.quarkus.runtime.annotations.Recorder; -import org.apache.camel.RoutesBuilder; -import org.apache.camel.quarkus.core.runtime.support.FastCamelRuntime; +import org.apache.camel.CamelContext; +import org.apache.camel.ExtendedCamelContext; +import org.apache.camel.RuntimeCamelException; +import org.apache.camel.quarkus.core.runtime.support.FastCamelContext; +import org.apache.camel.quarkus.core.runtime.support.FastModel; +import org.apache.camel.quarkus.core.runtime.support.RuntimeRegistry; import org.apache.camel.spi.Registry; +import org.graalvm.nativeimage.ImageInfo; @Recorder public class CamelRecorder { -public RuntimeValue create(Registry registry) { - -FastCamelRuntime fcr = new FastCamelRuntime(); -fcr.setRegistry(registry); - -return new RuntimeValue<>(fcr); -} - -public void init( -RuntimeValue runtime, -CamelConfig.BuildTime buildTimeConfig) { - -FastCamelRuntime fcr = (FastCamelRuntime) runtime.getValue(); -fcr.init(buildTimeConfig); +public RuntimeValue createRegistry() { +return new RuntimeValue<>(new RuntimeRegistry()); } -public void start( -ShutdownContext shutdown, -RuntimeValue runtime, -CamelConfig.Runtime runtimeConfig) throws Exception { +@SuppressWarnings("unchecked") +public RuntimeValue createContext(RuntimeValue registry, BeanContainer beanContainer, CamelConfig.BuildTime buildTimeConfig) { Review comment: Sorry I meant static init vs. runtime init. It matters for the kinds of resources available inside the method and it gives a hint about ordering. Of course, the info can be looked up in the IDE, but when in a comment, it helps to faster understand the context. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331482604 ## File path: extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/SubstrateProcessor.java ## @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.main.deployment; + +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.CombinedIndexBuildItem; +import io.quarkus.deployment.builditem.substrate.ReflectiveClassBuildItem; +import org.apache.camel.quarkus.core.deployment.CamelSupport; +import org.jboss.jandex.IndexView; + +public class SubstrateProcessor { Review comment: Thanks, makes sense. How about adding a class level JavaDoc something like `Produces BuildItems from the io.quarkus.deployment.builditem.substrate package` ? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel
lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331489009 ## File path: integration-tests/aws/pom.xml ## @@ -30,6 +30,10 @@ The camel integration tests + +org.apache.camel.quarkus +camel-quarkus-main + Review comment: You want to have a better control about the context initialization, set-up and life cycle as example. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] asf-ci commented on issue #226: Use MainSupport as base for running Camel
asf-ci commented on issue #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#issuecomment-538408842 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/camel-quarkus-pr/197/ This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-k] jacobborella edited a comment on issue #982: Operator fails on minikube
jacobborella edited a comment on issue #982: Operator fails on minikube URL: https://github.com/apache/camel-k/issues/982#issuecomment-538356955 Thx for the quick reply. It makes sense - and yes, I'm on a mac. If I execute `GOOS=linux make images` the build fails though. I'm reading through the cross compilation section of the go manual and I see that I also have to provide GOARCH=amd64. The build still fails though `env GOOS=linux GOARCH=amd64 make images` give ``` $ env GOOS=linux GOARCH=amd64 make images go build -ldflags "-X github.com/apache/camel-k/pkg/cmd/operator.GitCommit=6f0da195533b1b848388493a0529d11db54855ad" -gcflags=-trimpath=/Users/jacobborella/go -asmflags=-trimpath=/Users/jacobborella/go -o kamel ./cmd/kamel/*.go go test -c -tags="integration knative" ./e2e/*.go go test ./... ?github.com/apache/camel-k/cmd/kamel [no test files] ?github.com/apache/camel-k/cmd/util/json-schema-gen [no test files] ?github.com/apache/camel-k/deploy[no test files] ?github.com/apache/camel-k/pkg/apis [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b718/v1alpha1.test: exec format error FAIL github.com/apache/camel-k/pkg/apis/camel/v1alpha1 0.007s ?github.com/apache/camel-k/pkg/apis/camel/v1alpha1/knative [no test files] ?github.com/apache/camel-k/pkg/apis/knative08compat [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b722/builder.test: exec format error FAIL github.com/apache/camel-k/pkg/builder 0.010s ?github.com/apache/camel-k/pkg/builder/kaniko[no test files] ?github.com/apache/camel-k/pkg/builder/s2i [no test files] ?github.com/apache/camel-k/pkg/client[no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b725/cmd.test: exec format error FAIL github.com/apache/camel-k/pkg/cmd 0.015s ?github.com/apache/camel-k/pkg/cmd/builder [no test files] ?github.com/apache/camel-k/pkg/cmd/operator [no test files] ?github.com/apache/camel-k/pkg/controller[no test files] ?github.com/apache/camel-k/pkg/controller/build [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b728/integration.test: exec format error FAIL github.com/apache/camel-k/pkg/controller/integration0.009s ?github.com/apache/camel-k/pkg/controller/integrationkit [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b731/integrationplatform.test: exec format error FAIL github.com/apache/camel-k/pkg/controller/integrationplatform0.026s fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b734/gzip.test: exec format error FAIL github.com/apache/camel-k/pkg/gzip 0.006s ?github.com/apache/camel-k/pkg/install [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b737/metadata.test: exec format error FAIL github.com/apache/camel-k/pkg/metadata 0.006s ?github.com/apache/camel-k/pkg/platform [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b740/trait.test: exec format error FAIL github.com/apache/camel-k/pkg/trait 0.005s ?github.com/apache/camel-k/pkg/util [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b743/camel.test: exec format error FAIL github.com/apache/camel-k/pkg/util/camel0.011s ?github.com/apache/camel-k/pkg/util/cancellable [no test files] ?github.com/apache/camel-k/pkg/util/defaults [no test files] ?github.com/apache/camel-k/pkg/util/digest [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b746/envvar.test: exec format error FAIL github.com/apache/camel-k/pkg/util/envvar 0.007s ?github.com/apache/camel-k/pkg/util/finalizer[no test files] ?github.com/apache/camel-k/pkg/util/indentedwriter [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b749/knative.test: exec format error FAIL github.com/apache/camel-k/pkg/util/knative 0.005s fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b752/kubernetes.test: exec format error FAIL github.com/apache/camel-k/pkg/util/kubernetes 0.005s ?github.com/apache/camel-k/pkg/util/kubernetes/customclient [no test files] ?github.com/apache/camel-k/pkg/util/kubernetes/log [no test files] ?github.com/apache/camel-k/pkg/util/log [no test files] fork/exec /var/folders/p3/lt9l79r51cz7d43q98xp1kv0gn/T/go-build838360257/b755/maven.test: exec format error FAIL
[GitHub] [camel-quarkus] lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel
lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331477047 ## File path: extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/CustomDefaultServletClassTest.java ## @@ -30,25 +37,45 @@ @RegisterExtension static final QuarkusUnitTest CONFIG = new QuarkusUnitTest() .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) -.addClasses(Routes.class) -.addAsResource(new StringAsset( -"quarkus.camel.servlet.url-patterns=/*\n" -+ "quarkus.camel.servlet.servlet-name=my-named-servlet\n" -+ "quarkus.camel.servlet.servlet-class=" + CustomServlet.class.getName() + "\n"), -"application.properties")); +.addAsResource(applicationProperties(), "application.properties")); @Test -public void customDefaultServletClass() { -RestAssured.when().get("/custom").then() -.body(IsEqual.equalTo("GET: /custom")) -.and().header("x-servlet-class-name", CustomServlet.class.getName()); +public void customDefaultServletClass() throws Exception { +DefaultCamelContext context = new DefaultCamelContext(); +context.addRoutes(new Routes()); +context.start(); Review comment: camel-core does not loads routes anymore This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-k] astefanutti opened a new pull request #983: Add Kamel CLI download link to OpenShift Web console
astefanutti opened a new pull request #983: Add Kamel CLI download link to OpenShift Web console URL: https://github.com/apache/camel-k/pull/983 Fixes #939. **Release Note** ``` Add Kamel CLI download link to OpenShift Web console ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] asf-ci commented on issue #226: Use MainSupport as base for running Camel
asf-ci commented on issue #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#issuecomment-538389611 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/camel-quarkus-pr/196/ This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331497667 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRecorder.java ## @@ -16,88 +16,98 @@ */ package org.apache.camel.quarkus.core.runtime; -import io.quarkus.arc.runtime.BeanContainerListener; +import java.util.function.Supplier; + +import io.quarkus.arc.runtime.BeanContainer; import io.quarkus.runtime.RuntimeValue; -import io.quarkus.runtime.ShutdownContext; import io.quarkus.runtime.annotations.Recorder; -import org.apache.camel.RoutesBuilder; -import org.apache.camel.quarkus.core.runtime.support.FastCamelRuntime; +import org.apache.camel.CamelContext; +import org.apache.camel.ExtendedCamelContext; +import org.apache.camel.RuntimeCamelException; +import org.apache.camel.quarkus.core.runtime.support.FastCamelContext; +import org.apache.camel.quarkus.core.runtime.support.FastModel; +import org.apache.camel.quarkus.core.runtime.support.RuntimeRegistry; import org.apache.camel.spi.Registry; +import org.graalvm.nativeimage.ImageInfo; @Recorder public class CamelRecorder { -public RuntimeValue create(Registry registry) { - -FastCamelRuntime fcr = new FastCamelRuntime(); -fcr.setRegistry(registry); - -return new RuntimeValue<>(fcr); -} - -public void init( -RuntimeValue runtime, -CamelConfig.BuildTime buildTimeConfig) { - -FastCamelRuntime fcr = (FastCamelRuntime) runtime.getValue(); -fcr.init(buildTimeConfig); +public RuntimeValue createRegistry() { +return new RuntimeValue<>(new RuntimeRegistry()); } -public void start( -ShutdownContext shutdown, -RuntimeValue runtime, -CamelConfig.Runtime runtimeConfig) throws Exception { +@SuppressWarnings("unchecked") +public RuntimeValue createContext(RuntimeValue registry, BeanContainer beanContainer, CamelConfig.BuildTime buildTimeConfig) { Review comment: True, the set of all current callers is the ultimate source of the truth for each recorder method. But isn't this particular method based in the assumption that it will be called exactly once in a very specific phase? I guess these assumptions are supposed to stay rather stable over time and any future change will require a thorough review. Therefore documenting the assumptions might be a good idea. Maybe I am just projecting something into the code that really is not there? I do not want to nitpick, I want to understand myself and eventually make the understanding easier to the people who will read the code after us. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel
ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331497667 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRecorder.java ## @@ -16,88 +16,98 @@ */ package org.apache.camel.quarkus.core.runtime; -import io.quarkus.arc.runtime.BeanContainerListener; +import java.util.function.Supplier; + +import io.quarkus.arc.runtime.BeanContainer; import io.quarkus.runtime.RuntimeValue; -import io.quarkus.runtime.ShutdownContext; import io.quarkus.runtime.annotations.Recorder; -import org.apache.camel.RoutesBuilder; -import org.apache.camel.quarkus.core.runtime.support.FastCamelRuntime; +import org.apache.camel.CamelContext; +import org.apache.camel.ExtendedCamelContext; +import org.apache.camel.RuntimeCamelException; +import org.apache.camel.quarkus.core.runtime.support.FastCamelContext; +import org.apache.camel.quarkus.core.runtime.support.FastModel; +import org.apache.camel.quarkus.core.runtime.support.RuntimeRegistry; import org.apache.camel.spi.Registry; +import org.graalvm.nativeimage.ImageInfo; @Recorder public class CamelRecorder { -public RuntimeValue create(Registry registry) { - -FastCamelRuntime fcr = new FastCamelRuntime(); -fcr.setRegistry(registry); - -return new RuntimeValue<>(fcr); -} - -public void init( -RuntimeValue runtime, -CamelConfig.BuildTime buildTimeConfig) { - -FastCamelRuntime fcr = (FastCamelRuntime) runtime.getValue(); -fcr.init(buildTimeConfig); +public RuntimeValue createRegistry() { +return new RuntimeValue<>(new RuntimeRegistry()); } -public void start( -ShutdownContext shutdown, -RuntimeValue runtime, -CamelConfig.Runtime runtimeConfig) throws Exception { +@SuppressWarnings("unchecked") +public RuntimeValue createContext(RuntimeValue registry, BeanContainer beanContainer, CamelConfig.BuildTime buildTimeConfig) { Review comment: True, the set of all current callers is the ultimate source of the truth for each recorder method. But isn't this particular method based on the assumption that it will be called exactly once in a very specific phase? I guess these assumptions are supposed to stay rather stable over time and any future change will require a thorough review. Therefore documenting the assumptions might be a good idea. Maybe I am just projecting something into the code that really is not there? I do not want to nitpick, I want to understand myself and eventually make the understanding easier to the people who will read the code after us. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-k] astefanutti commented on issue #982: Build operator image from non-Linux local OS
astefanutti commented on issue #982: Build operator image from non-Linux local OS URL: https://github.com/apache/camel-k/issues/982#issuecomment-538359310 Ideally, the `kamel` binary produced for the Linux OS and added to the image should not override the local OS binary. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-k] astefanutti closed issue #794: All links of the documentation are missing spaces before and after displayed text
astefanutti closed issue #794: All links of the documentation are missing spaces before and after displayed text URL: https://github.com/apache/camel-k/issues/794 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-k] astefanutti commented on issue #794: All links of the documentation are missing spaces before and after displayed text
astefanutti commented on issue #794: All links of the documentation are missing spaces before and after displayed text URL: https://github.com/apache/camel-k/issues/794#issuecomment-538368253 It seems it's been fixed. Let me close this. Feel free to re-open if needed. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel
lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331477835 ## File path: integration-tests/aws/pom.xml ## @@ -30,6 +30,10 @@ The camel integration tests + +org.apache.camel.quarkus +camel-quarkus-main + Review comment: camel-quarkus-core is supposed to be used by people who want to create their own "main" whereas camel-quarkus-main does provide a ready to use "main" so no, component extensions should not depends on main otherwise it won't be possible for people to create their own main This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-k] astefanutti commented on issue #983: Add Kamel CLI download link to OpenShift Web console
astefanutti commented on issue #983: Add Kamel CLI download link to OpenShift Web console URL: https://github.com/apache/camel-k/pull/983#issuecomment-538378218 I'm undecided whether the CLI download link resource should be created as well during integration platform initialisation. This would enable installing the CLI for Camel K install done via Operator Hub. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel
lburgazzoli commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331487758 ## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRecorder.java ## @@ -16,88 +16,98 @@ */ package org.apache.camel.quarkus.core.runtime; -import io.quarkus.arc.runtime.BeanContainerListener; +import java.util.function.Supplier; + +import io.quarkus.arc.runtime.BeanContainer; import io.quarkus.runtime.RuntimeValue; -import io.quarkus.runtime.ShutdownContext; import io.quarkus.runtime.annotations.Recorder; -import org.apache.camel.RoutesBuilder; -import org.apache.camel.quarkus.core.runtime.support.FastCamelRuntime; +import org.apache.camel.CamelContext; +import org.apache.camel.ExtendedCamelContext; +import org.apache.camel.RuntimeCamelException; +import org.apache.camel.quarkus.core.runtime.support.FastCamelContext; +import org.apache.camel.quarkus.core.runtime.support.FastModel; +import org.apache.camel.quarkus.core.runtime.support.RuntimeRegistry; import org.apache.camel.spi.Registry; +import org.graalvm.nativeimage.ImageInfo; @Recorder public class CamelRecorder { -public RuntimeValue create(Registry registry) { - -FastCamelRuntime fcr = new FastCamelRuntime(); -fcr.setRegistry(registry); - -return new RuntimeValue<>(fcr); -} - -public void init( -RuntimeValue runtime, -CamelConfig.BuildTime buildTimeConfig) { - -FastCamelRuntime fcr = (FastCamelRuntime) runtime.getValue(); -fcr.init(buildTimeConfig); +public RuntimeValue createRegistry() { +return new RuntimeValue<>(new RuntimeRegistry()); } -public void start( -ShutdownContext shutdown, -RuntimeValue runtime, -CamelConfig.Runtime runtimeConfig) throws Exception { +@SuppressWarnings("unchecked") +public RuntimeValue createContext(RuntimeValue registry, BeanContainer beanContainer, CamelConfig.BuildTime buildTimeConfig) { Review comment: I can add them but it does not give much info and guarantees as in fact the behaviour depends to the target phase of the build steps that invokes the recorder. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] asf-ci commented on issue #226: Use MainSupport as base for running Camel
asf-ci commented on issue #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#issuecomment-538507707 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/camel-quarkus-pr/198/ This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on issue #226: Use MainSupport as base for running Camel
lburgazzoli commented on issue #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#issuecomment-538535999 @ppalaga @davsclaus do you mind a doing a final review ? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] lburgazzoli commented on issue #226: Use MainSupport as base for running Camel
lburgazzoli commented on issue #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#issuecomment-538535869 Move camel-main bits to camel-core, user can opt-out - thus have the full resposability of setting up and starting camel contest - by setting `quarkus.camel.disable-main = false` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [camel-quarkus] asf-ci commented on issue #226: Use MainSupport as base for running Camel
asf-ci commented on issue #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#issuecomment-538557724 Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/camel-quarkus-pr/199/ This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services