[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #846: Add AMQP extension

2020-03-04 Thread GitBox
ppalaga commented on a change in pull request #846: Add AMQP extension
URL: https://github.com/apache/camel-quarkus/pull/846#discussion_r387624512
 
 

 ##
 File path: 
extensions/amqp/deployment/src/main/java/org/apache/camel/quarkus/component/amqp/deployment/AmqpProcessor.java
 ##
 @@ -0,0 +1,81 @@
+/*
+ * 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.component.amqp.deployment;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import 
io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+
+class AmqpProcessor {
+
+private static final String QPID_JMS_SERRVICE_BASE = 
"META-INF/services/org/apache/qpid/jms/";
 
 Review comment:
   SERRVICE looks like a typo


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 #846: Add AMQP extension

2020-03-04 Thread GitBox
ppalaga commented on a change in pull request #846: Add AMQP extension
URL: https://github.com/apache/camel-quarkus/pull/846#discussion_r387628426
 
 

 ##
 File path: 
extensions/amqp/deployment/src/main/java/org/apache/camel/quarkus/component/amqp/deployment/AmqpProcessor.java
 ##
 @@ -0,0 +1,81 @@
+/*
+ * 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.component.amqp.deployment;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import 
io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+
+class AmqpProcessor {
+
+private static final String QPID_JMS_SERRVICE_BASE = 
"META-INF/services/org/apache/qpid/jms/";
+private static final String FEATURE = "camel-amqp";
+
+@BuildStep
+FeatureBuildItem feature() {
+return new FeatureBuildItem(FEATURE);
+}
+
+@BuildStep
+void registerServiceProviders(BuildProducer 
reflectiveClass,
+BuildProducer nativeImage) {
+String[] servicePaths = new String[] {
+QPID_JMS_SERRVICE_BASE + "provider/amqp",
+QPID_JMS_SERRVICE_BASE + "provider/amqps",
+QPID_JMS_SERRVICE_BASE + "provider/amqpws",
+QPID_JMS_SERRVICE_BASE + "provider/amqpwss",
+QPID_JMS_SERRVICE_BASE + "provider/failover",
+QPID_JMS_SERRVICE_BASE + "provider/redirects/ws",
+QPID_JMS_SERRVICE_BASE + "provider/redirects/wss",
+QPID_JMS_SERRVICE_BASE + "sasl/ANONYMOUS",
+QPID_JMS_SERRVICE_BASE + "sasl/CRAM-MD5",
+QPID_JMS_SERRVICE_BASE + "sasl/EXTERNAL",
+QPID_JMS_SERRVICE_BASE + "sasl/GSSAPI",
+QPID_JMS_SERRVICE_BASE + "sasl/SCRAM-SHA-1",
+QPID_JMS_SERRVICE_BASE + "sasl/SCRAM-SHA-256",
+QPID_JMS_SERRVICE_BASE + "sasl/XOAUTH2",
+QPID_JMS_SERRVICE_BASE + "tracing/noop",
+QPID_JMS_SERRVICE_BASE + "transports/ssl",
+QPID_JMS_SERRVICE_BASE + "transports/tcp",
+QPID_JMS_SERRVICE_BASE + "transports/ws",
+QPID_JMS_SERRVICE_BASE + "transports/wss",
+};
+
+for (String path : servicePaths) {
+reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, 
getServiceClass(path)));
+}
+
+nativeImage.produce(new NativeImageResourceBuildItem(servicePaths));
+}
+
+private String getServiceClass(String servicePath) {
+try {
+InputStream resource = 
AmqpProcessor.class.getClassLoader().getResourceAsStream(servicePath);
 
 Review comment:
   The stream does not get closed like this. Could you please put it into a 
`try()`?


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 #846: Add AMQP extension

2020-03-04 Thread GitBox
ppalaga commented on a change in pull request #846: Add AMQP extension
URL: https://github.com/apache/camel-quarkus/pull/846#discussion_r387629117
 
 

 ##
 File path: 
extensions/amqp/runtime/src/main/java/org/apache/camel/quarkus/component/amqp/graal/QpidJmsSubstitutions.java
 ##
 @@ -0,0 +1,50 @@
+/*
+ * 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.component.amqp.graal;
+
+import java.net.URI;
+
+import javax.net.ssl.SSLEngine;
+
+import com.oracle.svm.core.annotate.Substitute;
+import com.oracle.svm.core.annotate.TargetClass;
+import io.netty.buffer.ByteBufAllocator;
+import io.netty.handler.ssl.SslContext;
+import org.apache.qpid.jms.transports.TransportOptions;
+
+final class QpidJmsSubstitutions {
+}
+
+@TargetClass(className = "org.apache.qpid.jms.transports.TransportSupport")
+final class SubstituteTransportSupport {
+
+@Substitute
+public static boolean isOpenSSLPossible(TransportOptions options) {
+return false;
 
 Review comment:
   Would you please add a comment why the OpenSSL support is not possible?


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