quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.73k stars 2.67k forks source link

Need to publish Neo4J console for Dev Service #20624

Closed danieloh30 closed 2 years ago

danieloh30 commented 3 years ago

Describe the bug

When a Neo4J database stands up by Quarkus dev service, the Neo4J console(http://localhost:7474/browser) can't be accessible since the 7474 port wasn't published. If I run the Noe4J container manually with "--publish=7474:7474", I can access the console.

Expected behavior

The web console can be accessible via http://localhost:7474/browser/

Actual behavior

The web console can't be accessible via http://localhost:7474/browser/

How to Reproduce?

  1. Clone https://github.com/quarkusio/quarkus-quickstarts/tree/main/neo4j-quickstart
  2. Comment or remove all keys and values in the application.properties
  3. Run Quarku Dev Mode
  4. Access the Noe4J console via http://localhost:7474/browser/

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.3.0.Final

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

quarkus-bot[bot] commented 3 years ago

/cc @michael-simons

michael-simons commented 3 years ago

I agree that this would be nice to have and we can work on it, but I would hardly label it as a bug :)

You can always use Cypher Shell to connect to it or another browser instance and point either Cypher-Shell or the Browser to the connection string issued at startup.

michael-simons commented 3 years ago

I will investigate how to add this. Testcontainer allows both for exposing ports to random free ones (we use that for Bolt here) and which is usually preferred so that tests doesn't clash. It does also allow fixed ports.

What would be the preferred way for you, @danieloh30 ? Using fixed 7474 when available, something random else? Or, make it opt-in (..devservices.expose-browser = true) and fail hard if we decide to bring up devservices but 7474 is used?

gsmet commented 3 years ago

In several other devservices, we added the option to choose a fixed port (PostgreSQL for sure and probably others).

Probably a good idea to follow the same pattern.

danieloh30 commented 3 years ago

I'd say that a fixed port(7474) would be better by default to expose the web console since devs don't need to add any configurations in application.properties. Also, if we could add the port(e.g. ..devservices.expose-browser.port = xxxx), it would be even better.

michael-simons commented 3 years ago

I see:

https://github.com/quarkusio/quarkus/blob/main/extensions/devservices/postgresql/src/main/java/io/quarkus/devservices/postgresql/deployment/PostgresqlDevServicesProcessor.java#L83

and I agree. And than we should go the full way to have this both for bolt and the Browser.

I'll certainly can add this, but only after mid October…

michael-simons commented 3 years ago

(just to be clear, our driver is completely independent from the browser console and browser console uses the JavaScript version of the driver to speak with the db, so it's a bit more than just exposing the browser port and hope things work…)

danieloh30 commented 3 years ago

Cool. Sounds like a plan. Thanks @michael-simons

sandronm commented 2 years ago

Hello @michael-simons , any news about this feature to be able to set a port for this Dev Service? It will be very convenient! :)

michael-simons commented 2 years ago

Glad you asked, @sandronm :) See attached PR and check whether it makes sense for you.

You can build Quarkus from my fork like this

./mvnw -Dquickly   
./mvnw -DskipTests install -pl io.quarkus:quarkus-neo4j -pl io.quarkus:quarkus-neo4j-deployment -pl io.quarkus:quarkus-neo4j-parent

qdevservices.zip

and test it with the attached project for example.