jamesnetherton commented on code in PR #8645:
URL: https://github.com/apache/camel-quarkus/pull/8645#discussion_r3216691918
##########
pom.xml:
##########
@@ -47,6 +47,7 @@
<camel-kamelets.version>4.20.0</camel-kamelets.version>
<cassandra-quarkus.version>1.4.1</cassandra-quarkus.version><!-- This
should be in sync with quarkus-platform
https://repo1.maven.org/maven2/com/datastax/oss/quarkus/cassandra-quarkus-bom/
-->
<debezium.version>3.5.0.Final</debezium.version> <!-- This should be
in sync with quarkus-platform https://github.com/quarkusio/quarkus-platform-->
+ <rocketmq.version>5.3.2</rocketmq.version><!-- @sync
org.apache.camel:camel-rocketmq:${camel.version}
dep:org.apache.rocketmq:rocketmq-client -->
Review Comment:
We can just use the version property inherited from the `camel-dependencies`
parent.
```suggestion
<rocketmq.version>${rocketmq-version}</rocketmq.version>
```
##########
integration-tests/rocketmq/src/main/java/org/apache/camel/quarkus/component/rocketmq/it/RocketmqConfiguration.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * 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.rocketmq.it;
+
+import jakarta.enterprise.inject.Produces;
+import jakarta.inject.Named;
+import jakarta.inject.Singleton;
+import org.apache.camel.component.rocketmq.RocketMQComponent;
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+
+public class RocketmqConfiguration {
+
+ @ConfigProperty(name = "rocketmq.namesrv.addr")
+ String namesrvAddr;
+
+ @Produces
+ @Named
+ @Singleton
+ RocketMQComponent rocketmq() {
+ RocketMQComponent component = new RocketMQComponent();
+ component.setNamesrvAddr(namesrvAddr);
+ return component;
Review Comment:
You can probably remove this class entirely and just set property
`camel.component.rocketmq.namesrv-addr` from the `Map` returned from
`RocketmqTestResource.start()`.
##########
extensions/rocketmq/deployment/src/main/java/org/apache/camel/quarkus/component/rocketmq/deployment/RocketmqProcessor.java:
##########
@@ -0,0 +1,149 @@
+/*
+ * 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.rocketmq.deployment;
+
+import java.util.List;
+
+import com.alibaba.fastjson.parser.ParserConfig;
+import com.alibaba.fastjson.serializer.SerializeConfig;
+import com.alibaba.fastjson.util.ASMClassLoader;
+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.FeatureBuildItem;
+import
io.quarkus.deployment.builditem.nativeimage.NativeImageAllowIncompleteClasspathBuildItem;
+import
io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import
io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
+import
io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedPackageBuildItem;
+import
org.apache.camel.quarkus.component.rocketmq.runtime.CamelRocketmqRecorder;
+import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
+
+class RocketmqProcessor {
+
+ private static final String FEATURE = "camel-rocketmq";
+
+ private static final List<String> ROCKETMQ_REFLECTIVE_CLASSES = List.of(
+ "org.apache.rocketmq.client.ClientConfig",
+ "org.apache.rocketmq.client.consumer.DefaultMQPushConsumer",
+ "org.apache.rocketmq.common.message.MessageQueue",
+ "org.apache.rocketmq.remoting.protocol.RemotingCommand",
+ "org.apache.rocketmq.remoting.protocol.RemotingSerializable",
+ "org.apache.rocketmq.remoting.protocol.body.ConsumeStatus",
+ "org.apache.rocketmq.remoting.protocol.body.ConsumerRunningInfo",
+ "org.apache.rocketmq.remoting.protocol.body.ProcessQueueInfo",
+
"org.apache.rocketmq.remoting.protocol.header.GetConsumerListByGroupRequestHeader",
+
"org.apache.rocketmq.remoting.protocol.header.GetConsumerListByGroupResponseBody",
+
"org.apache.rocketmq.remoting.protocol.header.GetConsumerRunningInfoRequestHeader",
+
"org.apache.rocketmq.remoting.protocol.header.HeartbeatRequestHeader",
+
"org.apache.rocketmq.remoting.protocol.header.NotifyConsumerIdsChangedRequestHeader",
+
"org.apache.rocketmq.remoting.protocol.header.PullMessageRequestHeader",
+
"org.apache.rocketmq.remoting.protocol.header.QueryConsumerOffsetRequestHeader",
+
"org.apache.rocketmq.remoting.protocol.header.QueryConsumerOffsetResponseHeader",
+
"org.apache.rocketmq.remoting.protocol.header.SendMessageRequestHeaderV2",
+
"org.apache.rocketmq.remoting.protocol.header.UnregisterClientRequestHeader",
+
"org.apache.rocketmq.remoting.protocol.header.UpdateConsumerOffsetRequestHeader",
+
"org.apache.rocketmq.remoting.protocol.header.namesrv.GetRouteInfoRequestHeader",
+ "org.apache.rocketmq.remoting.protocol.heartbeat.ConsumerData",
+ "org.apache.rocketmq.remoting.protocol.heartbeat.HeartbeatData",
+ "org.apache.rocketmq.remoting.protocol.heartbeat.ProducerData",
+ "org.apache.rocketmq.remoting.protocol.heartbeat.SubscriptionData",
+ "org.apache.rocketmq.remoting.protocol.route.BrokerData",
+ "org.apache.rocketmq.remoting.protocol.route.QueueData",
+ "org.apache.rocketmq.remoting.protocol.route.TopicRouteData",
+ "org.apache.rocketmq.remoting.rpc.RpcRequestHeader",
+ "org.apache.rocketmq.remoting.rpc.TopicQueueRequestHeader",
+ "org.apache.rocketmq.remoting.rpc.TopicRequestHeader");
+
+ private static final List<String> ROCKETMQ_NETTY_REFLECTIVE_CLASSES =
List.of(
+ "org.apache.rocketmq.common.logging.DefaultJoranConfiguratorExt",
+ "org.apache.rocketmq.remoting.netty.NettyDecoder",
+ "org.apache.rocketmq.remoting.netty.NettyEncoder",
+ "org.apache.rocketmq.remoting.netty.NettyRemotingClient$2",
+
"org.apache.rocketmq.remoting.netty.NettyRemotingClient$NettyClientHandler",
+
"org.apache.rocketmq.remoting.netty.NettyRemotingClient$NettyConnectManageHandler",
+
"org.apache.rocketmq.remoting.protocol.header.PullMessageResponseHeader",
+
"org.apache.rocketmq.remoting.protocol.header.SendMessageResponseHeader");
+
+ private static final List<String> ROCKETMQ_REFLECTIVE_ENUMS = List.of(
+ "org.apache.rocketmq.common.consumer.ConsumeFromWhere",
+ "org.apache.rocketmq.remoting.protocol.LanguageCode",
+ "org.apache.rocketmq.remoting.protocol.RequestCode",
+ "org.apache.rocketmq.remoting.protocol.ResponseCode",
+ "org.apache.rocketmq.remoting.protocol.SerializeType",
+ "org.apache.rocketmq.remoting.protocol.heartbeat.ConsumeType",
+ "org.apache.rocketmq.remoting.protocol.heartbeat.MessageModel");
+
+ @BuildStep
+ FeatureBuildItem feature() {
+ return new FeatureBuildItem(FEATURE);
+ }
+
+ @BuildStep
+ NativeImageAllowIncompleteClasspathBuildItem allowIncompleteClasspath() {
+ return new NativeImageAllowIncompleteClasspathBuildItem(FEATURE);
+ }
Review Comment:
Must we really set this? Generally for Quarkus it's a last resort to get
things working in native mode.
Maybe there are some GraalVM substitutions or deletions that could help to
get things working wile not requiring incomplete-classpath.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]