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

HTTP random port not working with MQTT client connector #778

Closed
phillip-kruger opened this issue Sep 25, 2020 · 8 comments
Closed

HTTP random port not working with MQTT client connector #778

phillip-kruger opened this issue Sep 25, 2020 · 8 comments
Assignees
Labels

Comments

@phillip-kruger
Copy link
Member

This is a quarkus bug. When using MQTT and vertx, and setting the http port to random, the application fails to start up.
code-with-quarkus.zip

Reproducer attached.

@cescoffier
Copy link
Contributor

Thanks @phillip-kruger ! I will have a look today.

@cescoffier
Copy link
Contributor

So, I had a look and it's more tricky than expected.
If I delay the connection artificially it works, if you don't use the port 0, it works...

It may not be related to SmallRye Reactive Messaging (directly). It works with Quarkus 1.7.3.Final but not since 1.8.0. In between, Vert.x Core changed how port 0 is handled. It may have introduced this new bug. There are also recent changes in the MQTT client regarding when the connection is done.

@vietj do you see any reason why with Vert.x 3.9.3, the HTTP server configured on the port 0 fails with a bind exception?

@cescoffier cescoffier changed the title Random port not working with MQTT HTTP random port not working with MQTT client connector Sep 25, 2020
@vietj
Copy link

vietj commented Sep 28, 2020

@phillip-kruger can you adapt the reproducer to use only Vert.x ? that will make it easier for us to debug

@vietj
Copy link

vietj commented Sep 29, 2020

can you elaborate on how to use the reproducer ? the only thing I see is a single class

@ApplicationScoped
public class ExampleResource {
    
    @Incoming("bla")
    public CompletionStage<Void> bla(Message<byte[]> message){
        return message.ack();
    }
}

and nothing else

@vietj
Copy link

vietj commented Sep 29, 2020

ah ok it is failure to startup

@vietj
Copy link

vietj commented Sep 29, 2020

is that possible to run it with a main in the IDE ?

@vietj
Copy link

vietj commented Sep 29, 2020

there are no instructions in this project for creating an MQTT server , so instead I used test.mosquitto.org then started the fat jar and I did not see any issue:

MBP-de-Julien:code-with-quarkus julien$ java -jar target/code-with-quarkus-1.0.0-SNAPSHOT-runner.jar 
__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2020-09-29 13:13:54,254 INFO  [io.sma.rea.mes.provider] (main) SRMSG00208: Deployment done... start processing
2020-09-29 13:13:54,279 INFO  [io.sma.rea.mes.provider] (main) SRMSG00226: Found incoming connectors: [smallrye-mqtt]
2020-09-29 13:13:54,281 INFO  [io.sma.rea.mes.provider] (main) SRMSG00227: Found outgoing connectors: [smallrye-mqtt]
2020-09-29 13:13:54,282 INFO  [io.sma.rea.mes.provider] (main) SRMSG00229: Channel manager initializing...
2020-09-29 13:13:54,333 INFO  [io.sma.rea.mes.provider] (main) SRMSG00209: Initializing mediators
2020-09-29 13:13:54,344 INFO  [io.sma.rea.mes.provider] (main) SRMSG00215: Connecting mediators
2020-09-29 13:13:54,344 INFO  [io.sma.rea.mes.provider] (main) SRMSG00216: Attempt to resolve org.acme.ExampleResource#bla
2020-09-29 13:13:54,345 INFO  [io.sma.rea.mes.provider] (main) SRMSG00217: Connecting org.acme.ExampleResource#bla to `[bla]` (org.eclipse.microprofile.reactive.streams.operators.core.PublisherBuilderImpl@4b7e96a)
2020-09-29 13:13:54,515 INFO  [io.quarkus] (main) code-with-quarkus 1.0.0-SNAPSHOT on JVM (powered by Quarkus 1.8.1.Final) started in 0.859s. Listening on: http://0.0.0.0:56141
2020-09-29 13:13:54,515 INFO  [io.quarkus] (main) Profile prod activated. 
2020-09-29 13:13:54,515 INFO  [io.quarkus] (main) Installed features: [cdi, mutiny, smallrye-context-propagation, smallrye-reactive-messaging, smallrye-reactive-messaging-mqtt, vertx, vertx-web]
2020-09-29 13:13:54,540 INFO  [io.ver.mqt.imp.MqttClientImpl] (vert.x-eventloop-thread-0) Connection with test.mosquitto.org:1883 established successfully

can you give the steps to reproduce the issue ?

@cescoffier
Copy link
Contributor

This is a Quarkus issue. See quarkusio/quarkus#12401.
Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants