20

I have two apps running.

App1: Read from amq, enrich the message and send the message to App2 through other amq

App2: Read the message and call another project for processing.

Y want to debug booth Apps in the same time and see how the message change in time.

When I start the App2 with mvn compile quarkus:dev I got this:

[ERROR] Port 5005 in use, not starting in debug mode

of course the app is runnig but without debuger.

Exist some way to change the default debug port in quarkus?

PD: I just try -Dquarkus.debug.port=5006, but nothing happens...

Thanks

Victor Avila
  • 353
  • 1
  • 3
  • 10

4 Answers4

30

The -Ddebug system property can be used to specify a debug port as well. In your case, mvn compile quarkus:dev -Ddebug=5006 should work.

See this javadoc https://github.com/quarkusio/quarkus/blob/1.8.1.Final/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java#L140-L166 for more info.

Ladicek
  • 5,970
  • 17
  • 20
  • If you expose an HTTP endpoint, you'll also get an error that port 8080 is already taken. To fix both use `mvn quarkus:dev -Ddebug=5006 -Dquarkus.http.port=8081` – Japu_D_Cret Sep 24 '21 at 08:35
3

Add a configuration on quarkus-maven-plugin.

1 Go to your pom;

2 Find the plugin tag;

3 Add configuration tag pair;

4 Add debug tag pair;

5 Insert the port you want on step 4;

6 Start your application and check the logs. You are good to go.

Example:

  <plugin>
    <groupId>${quarkus.platform.group-id}</groupId>
    <artifactId>quarkus-maven-plugin</artifactId>
    <version>${quarkus.platform.version}</version>
    <configuration>
      <debug>6006</debug>
    </configuration>
    <extensions>true</extensions>
    <executions>
      <execution>
        <goals>
          <goal>build</goal>
          <goal>generate-code</goal>
          <goal>generate-code-tests</goal>
        </goals>
      </execution>
    </executions>
  </plugin>
  <plugin>

Debugging on wanted port log

0

You can also check the process running on that port & kill it manually. Below are the commands to do it in the Windows OS using PowerShell:

> Get-Process -Id (Get-NetTCPConnection -LocalPort 8080).OwningProcess 
> taskkill /f /PID <pid-got-from-above-command>
Neetu T
  • 1
  • 1
0

For those using Gradle, you can set the debug port in each application's build.gradle, like this:

quarkusDev {
    doFirst {
        System.setProperty("debug", "5101") // APP1 debug port
    }
}
Mark Warren
  • 211
  • 2
  • 3