Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up usage of hard coded hosts that use containers #5509

Merged
merged 2 commits into from
Nov 15, 2023

Conversation

jamesnetherton
Copy link
Contributor

No description provided.

Copy link
Contributor

@zhfeng zhfeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also needs to do in PahoMqtt5TestResource.java

result = CollectionHelper.mapOf(
"paho5.broker.tcp.url", "tcp://localhost:" + port);
and
if (!useFixedPort) {
result = CollectionHelper.mapOf(
"camel.component.paho-mqtt5.username", MQTT_USERNAME,
"camel.component.paho-mqtt5.password", MQTT_PASSWORD,
"paho5.broker.tcp.url", String.format("tcp://localhost:%d", container.getMappedPort(TCP_PORT)),
"paho5.broker.ssl.url", String.format("ssl://localhost:%d", container.getMappedPort(SSL_PORT)),
"paho5.broker.ws.url", String.format("ws://localhost:%d", container.getMappedPort(WS_PORT)));
}

@jamesnetherton jamesnetherton force-pushed the cleanup-hard-coded-hosts branch from 96ef942 to 75823cc Compare November 15, 2023 08:39
@jamesnetherton
Copy link
Contributor Author

It also needs to do in PahoMqtt5TestResource.java

Thanks, I made work like the other paho test. The downside is that when using a custom HostnameVerifier org.eclipse.paho.mqttv5.client.internal.NetworkModuleService does reflection on an internal JDK class java.net.URI. So I had to --add-opens to deal with that.

Copy link
Contributor

@zhfeng zhfeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that makes sense.

@@ -15,3 +15,6 @@
## limitations under the License.
## ---------------------------------------------------------------------------
quarkus.native.resources.includes=*.jks

# Required by NetworkModuleService.setURIField
quarkus.native.additional-build-args=-J--add-opens=java.base/java.net=ALL-UNNAMED
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add some notes in docs of paho-mqtt5? is it only needed in ssl cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went back to look at it again. And the test is actually passing without it.

Maybe I previously had something misconfigured that triggered the problem code in NetworkModuleService.

I can revert the --add-opens and create follow up issue to investigate further as there's potentially an issue there for some scenarios (to be verified). WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, it looks good to me.

@jamesnetherton jamesnetherton force-pushed the cleanup-hard-coded-hosts branch from 75823cc to 80b7cdb Compare November 15, 2023 11:09
@jamesnetherton jamesnetherton force-pushed the cleanup-hard-coded-hosts branch from 80b7cdb to e6896d0 Compare November 15, 2023 13:51
@jamesnetherton jamesnetherton merged commit 51d58e6 into apache:main Nov 15, 2023
@jamesnetherton jamesnetherton deleted the cleanup-hard-coded-hosts branch November 15, 2023 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants