vert-x3 / vertx-mqtt

Vert.x MQTT
Apache License 2.0
184 stars 86 forks source link

Opt proxy protocol #158

Closed sdvdxl closed 3 years ago

sdvdxl commented 4 years ago

Signed-off-by: sdvdxl sdvdxl@163.com

Motivation:

Vertx supports proxy settings and override options methods to facilitate calls. #152

ppatierno commented 4 years ago

Do you think it's possible to write a test for this?

vietj commented 4 years ago

there is in vertx-tests an utility class to setup a fake minimalist proxy for this https://github.com/eclipse-vertx/vert.x/blob/master/src/test/java/io/vertx/test/proxy/HAProxy.java that can be reused

vietj commented 4 years ago

well it's a real proxy :-)

sdvdxl commented 4 years ago

Do you think it's possible to write a test for this?

I add 2 tests. V1_TCP4 and V2_TCP4

vietj commented 4 years ago

can you add ref the example12 in the index.adoc file and document it ?

ppatierno commented 4 years ago

@vietj why Travis is complaining with following ...

io.vertx.docgen.DocGenException: Could not resolve examples.VertxMqttClientExamples#example12

This is a server example not a client one.

vietj commented 4 years ago

changes the ref in the asciidoc file

ppatierno commented 4 years ago

@vietj I don't have rights for restart Travis build, can you do that?

vietj commented 4 years ago

done

On 4 Jun 2020, at 08:44, Paolo Patierno notifications@github.com wrote:

@vietj https://github.com/vietj I don't have rights for restart Travis build, can you do that?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vert-x3/vertx-mqtt/pull/158#issuecomment-638638267, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABXDCULFSYFX6QLN6NMOODRU47GNANCNFSM4NQJMVIQ.

ppatierno commented 4 years ago

@sdvdxl Travis is still failing. Are you able to run the entire tests suite locally?

sdvdxl commented 4 years ago

@sdvdxl Travis is still failing. Are you able to run the entire tests suite locally?

@ppatierno The local tests passed, but on my other remote machine it was stuck at MqttServerMaxMessageSizeTest and could no longer be executed.

local is mac os, other is CentOS7

sdvdxl commented 4 years ago

I think the issue maybe is line 71 of MqttServerMaxMessageSizeTest: client.publish(MQTT_TOPIC, message, 0, false);.

The message over the max bytes, and the sever throw a exception, the client wait forever(client default timeout is -1)

sdvdxl commented 4 years ago

Before client.connect(); I set client.setTimeToWait(TimeUnit.SECONDS.toMillis(3)); after running a few times(sometime passed, sometime failed) then print:

Timed out waiting for a response from the server (32000)
    at org.eclipse.paho.client.mqttv3.internal.Token.waitForCompletion(Token.java:112)
    at org.eclipse.paho.client.mqttv3.MqttToken.waitForCompletion(MqttToken.java:67)
    at org.eclipse.paho.client.mqttv3.MqttClient.publish(MqttClient.java:399)

See this pr Fix MQTT client hangs after publishing with QoS 0 , and issue MQTT client waits for ACK after publishing with QoS 0

ppatierno commented 4 years ago

@sdvdxl tbh I am not sure how this fix the "problem". You are waiting asynchronously during a connection before publishing the message. The synchronous connection is used on all over the other tests, right? And it works fine.

vietj commented 4 years ago

what is the status on this issue @ppatierno ?

ppatierno commented 4 years ago

@vietj I raised a problem but I don't see any changes from @sdvdxl

vietj commented 3 years ago

@sdvdxl ping we would like to merge this PR

vietj commented 3 years ago

cherry-picked and merged in master https://github.com/vert-x3/vertx-mqtt/commit/9a91ad811c4e9fbe47306fc2666f9bc4bc8ec33c