Re: [PR] Fixes #8644 Add RocketMQ extension [camel-quarkus]
jamesnetherton commented on PR #8645: URL: https://github.com/apache/camel-quarkus/pull/8645#issuecomment-4448123107 Thanks for contributing @phateffect! -- 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]
Re: [PR] Fixes #8644 Add RocketMQ extension [camel-quarkus]
jamesnetherton merged PR #8645: URL: https://github.com/apache/camel-quarkus/pull/8645 -- 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]
Re: [PR] Fixes #8644 Add RocketMQ extension [camel-quarkus]
phateffect commented on PR #8645:
URL: https://github.com/apache/camel-quarkus/pull/8645#issuecomment-4440943951
> > replace `${rocketmq.version}` with `${rocketmq-version}` @jamesnetherton
please take a look, thank you!
>
> Oh I'm sorry @phateffect, I mislead you. I did not realise the version
property was being used for dependencies in `poms/bom/pom.xml`. Can you revert
[6aa0e7b](https://github.com/apache/camel-quarkus/pull/8645/commits/6aa0e7b40670029373640d0461ca4c23d7127fd0).
sure
--
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]
Re: [PR] Fixes #8644 Add RocketMQ extension [camel-quarkus]
jamesnetherton commented on PR #8645:
URL: https://github.com/apache/camel-quarkus/pull/8645#issuecomment-4440893388
> replace `${rocketmq.version}` with `${rocketmq-version}` @jamesnetherton
please take a look, thank you!
Oh I'm sorry @phateffect, I mislead you. I did not realise the version
property was being used for dependencies in `poms/bom/pom.xml`. Can you revert
[6aa0e7b](https://github.com/apache/camel-quarkus/pull/8645/commits/6aa0e7b40670029373640d0461ca4c23d7127fd0).
--
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]
Re: [PR] Fixes #8644 Add RocketMQ extension [camel-quarkus]
phateffect commented on PR #8645:
URL: https://github.com/apache/camel-quarkus/pull/8645#issuecomment-4440616906
replace `${rocketmq.version}` with `${rocketmq-version}`
@jamesnetherton please take a look, thank you!
--
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]
Re: [PR] Fixes #8644 Add RocketMQ extension [camel-quarkus]
jamesnetherton commented on code in PR #8645: URL: https://github.com/apache/camel-quarkus/pull/8645#discussion_r3232454617 ## pom.xml: ## @@ -47,6 +47,7 @@ 4.20.0 1.4.1 3.5.0.Final
Re: [PR] Fixes #8644 Add RocketMQ extension [camel-quarkus]
phateffect commented on PR #8645: URL: https://github.com/apache/camel-quarkus/pull/8645#issuecomment-4436759245 @jamesnetherton the ci failure seems like a network flake. could you please retry 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] Fixes #8644 Add RocketMQ extension [camel-quarkus]
phateffect commented on PR #8645: URL: https://github.com/apache/camel-quarkus/pull/8645#issuecomment-4433397739 Thanks for the feedback @aldettinger! I have: - Removed the redundant RocketMQ dependencies - use `AvailablePortFinder.getNextAvailable()` helper @jamesnetherton I've attempted to fix the connection issues by introducing `RocketMQBrokerContainer` to handle port bindings more cleanly. Could you please trigger the tests again? Thanks! -- 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]
Re: [PR] Fixes #8644 Add RocketMQ extension [camel-quarkus]
phateffect commented on code in PR #8645: URL: https://github.com/apache/camel-quarkus/pull/8645#discussion_r3228708676 ## extensions/rocketmq/runtime/pom.xml: ## @@ -0,0 +1,216 @@ + + +http://maven.apache.org/POM/4.0.0"; + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd";> +4.0.0 + +org.apache.camel.quarkus +camel-quarkus-rocketmq-parent +3.36.0-SNAPSHOT +../pom.xml + + +camel-quarkus-rocketmq +Camel Quarkus :: RocketMQ :: Runtime +Send and receive messages from RocketMQ cluster. + + +3.36.0 +3.36.0 + + + + +io.quarkus +quarkus-netty + + +org.apache.camel.quarkus +camel-quarkus-core + + +org.apache.camel.quarkus +camel-quarkus-support-commons-logging + + +org.apache.rocketmq +rocketmq-client + + +commons-logging +commons-logging + + + + +org.apache.rocketmq +rocketmq-acl Review Comment: remove redundant rocketmq deps -- 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]
Re: [PR] Fixes #8644 Add RocketMQ extension [camel-quarkus]
aldettinger commented on code in PR #8645:
URL: https://github.com/apache/camel-quarkus/pull/8645#discussion_r3225598535
##
integration-tests/rocketmq/src/test/java/org/apache/camel/quarkus/component/rocketmq/it/RocketmqTestResource.java:
##
@@ -0,0 +1,159 @@
+/*
+ * 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 java.io.IOException;
+import java.net.ServerSocket;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import com.github.dockerjava.api.model.ExposedPort;
+import com.github.dockerjava.api.model.HostConfig;
+import com.github.dockerjava.api.model.Ports;
+import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
+import org.eclipse.microprofile.config.ConfigProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.Network;
+import org.testcontainers.containers.wait.strategy.Wait;
+import org.testcontainers.images.builder.Transferable;
+
+public class RocketmqTestResource implements
QuarkusTestResourceLifecycleManager {
+
+private static final Logger LOG =
LoggerFactory.getLogger(RocketmqTestResource.class);
+private static final String ROCKETMQ_IMAGE = ConfigProvider.getConfig()
+.getValue("rocketmq.container.image", String.class);
+private static final int NAMESRV_PORT = 9876;
+
+private GenericContainer namesrvContainer;
+private GenericContainer brokerContainer;
+private Network network;
+
+@Override
+public Map start() {
+network = Network.newNetwork();
+
+namesrvContainer = new GenericContainer<>(ROCKETMQ_IMAGE)
+.withNetwork(network)
+.withNetworkAliases("namesrv")
+.withExposedPorts(NAMESRV_PORT)
+.withCommand("sh", "mqnamesrv")
+.waitingFor(Wait.forLogMessage(".*The Name Server boot
success.*", 1));
+
+namesrvContainer.start();
+
+int brokerPort = availablePort();
+String brokerConf = String.format(
+
"brokerIP1=%s%nlistenPort=%d%nbrokerName=broker-a%nbrokerClusterName=DefaultCluster%n",
+namesrvContainer.getHost(), brokerPort);
+
+brokerContainer = new GenericContainer<>(ROCKETMQ_IMAGE)
+.withNetwork(network)
+.withNetworkAliases("broker")
+
.withCopyToContainer(Transferable.of(brokerConf.getBytes(StandardCharsets.UTF_8)),
"/tmp/broker.conf")
+.withCommand("sh", "mqbroker", "-n", "namesrv:9876", "-c",
"/tmp/broker.conf")
+.dependsOn(namesrvContainer)
+.withCreateContainerCmdModifier(createContainerCmd -> {
+Ports portBindings = new Ports();
+portBindings.bind(ExposedPort.tcp(brokerPort),
Ports.Binding.bindPort(brokerPort));
+HostConfig hostConfig = HostConfig.newHostConfig()
+.withPortBindings(portBindings)
+.withNetworkMode(network.getId());
+createContainerCmd.withHostConfig(hostConfig);
+})
+.waitingFor(Wait.forLogMessage(".*The broker\\[.*\\] boot
success.*", 1));
+
+brokerContainer.start();
+
+createTopic();
+
+Map properties = new HashMap<>();
+properties.put("camel.component.rocketmq.namesrv-addr",
+namesrvContainer.getHost() + ":" +
namesrvContainer.getMappedPort(NAMESRV_PORT));
+LOG.info("RocketMQ test properties: {}", properties);
+return properties;
+}
+
+private void createTopic() {
+long deadline = System.nanoTime() + TimeUnit.SECONDS.toNanos(30);
+org.testcontainers.containers.Container.ExecResult lastResult = null;
+
+while (System.nanoTime() < deadline) {
+lastResult = updateTopic();
+if (lastResult.getExitCode() == 0 &&
lastResult.getStdout().contains("success")) {
+LOG.info("Topic creation stdout: {}", lastResult.getStdout());
+
Re: [PR] Fixes #8644 Add RocketMQ extension [camel-quarkus]
aldettinger commented on code in PR #8645: URL: https://github.com/apache/camel-quarkus/pull/8645#discussion_r3225500105 ## extensions/rocketmq/runtime/pom.xml: ## @@ -0,0 +1,216 @@ + + +http://maven.apache.org/POM/4.0.0"; + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd";> +4.0.0 + +org.apache.camel.quarkus +camel-quarkus-rocketmq-parent +3.36.0-SNAPSHOT +../pom.xml + + +camel-quarkus-rocketmq +Camel Quarkus :: RocketMQ :: Runtime +Send and receive messages from RocketMQ cluster. + + +3.36.0 +3.36.0 + + + + +io.quarkus +quarkus-netty + + +org.apache.camel.quarkus +camel-quarkus-core + + +org.apache.camel.quarkus +camel-quarkus-support-commons-logging + + +org.apache.rocketmq +rocketmq-client + + +commons-logging +commons-logging + + + + +org.apache.rocketmq +rocketmq-acl Review Comment: Isn't this dependency already brought by camel-rocketmq ? -- 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]
Re: [PR] Fixes #8644 Add RocketMQ extension [camel-quarkus]
jamesnetherton commented on PR #8645: URL: https://github.com/apache/camel-quarkus/pull/8645#issuecomment-4428343536 The RocketMQ tests are failing - seems there are some connectivity issues. I attached the test logs below. [rocketmq-tests.log](https://github.com/user-attachments/files/27625829/rocketmq-tests.log) -- 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]
Re: [PR] Fixes #8644 Add RocketMQ extension [camel-quarkus]
phateffect commented on PR #8645: URL: https://github.com/apache/camel-quarkus/pull/8645#issuecomment-4424161489 Hi @jamesnetherton, thanks for the helpful review. I've addressed all the feedback in the latest commits: 1. Now using the version property inherited from camel-dependencies. 2. Removed the unnecessary configuration class and updated it to use the property returned from RocketmqTestResource.start(). 3. Removed NativeImageAllowIncompleteClasspathBuildItem. Instead, I've added a GraalVM substitution for MonetaCodec to mask the optional javax.money dependency. -- 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]
Re: [PR] Fixes #8644 Add RocketMQ extension [camel-quarkus]
phateffect commented on code in PR #8645:
URL: https://github.com/apache/camel-quarkus/pull/8645#discussion_r3221548043
##
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 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 ROCKETMQ_NETTY_REFLECTIVE_CLASSES =
List.of(
+"org.apache.rocketmq.common.logging.DefaultJoranConfiguratorExt",
+"org.apache.
Re: [PR] Fixes #8644 Add RocketMQ extension [camel-quarkus]
jamesnetherton commented on code in PR #8645:
URL: https://github.com/apache/camel-quarkus/pull/8645#discussion_r3216691918
##
pom.xml:
##
@@ -47,6 +47,7 @@
4.20.0
1.4.1
3.5.0.Final
Review Comment:
We can just use the version property inherited from the `camel-dependencies`
parent.
```suggestion
${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 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.
