Quarkus 備忘録

  • quarkus:dev で jvmArgs
      <plugin>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>build</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <jvmArgs>-XX:+UnlockExperimentalVMOptions -XX:hashCode=0</jvmArgs>
        </configuration>
      </plugin>
  • suspend して debugger 待ち
mvn clean compile quarkus:dev -DskipTests -Dsuspend=true
  • container で native build も簡単
./mvnw package -Pnative -Dquarkus.native.container-build=true
  • できている native image に対してテスト
./mvnw test-compile failsafe:integration-test

Logging

quarkus.log.level=INFO
quarkus.log.category."org.hibernate".level=DEBUG

quarkus-maven-plugin

  • GenerateCodeMojo (mvn debug 18787) QuarkusBootstrap -> CuratedApplication -> QuarkusClassLoader

    CodeGenerator -> List = []

  • DevMojo (mvn debug 18787)

    DevModeRunner

    debug port

    DevModeRunner.run() -> java.lang.ProcessBuilder -> java.lang.ProcessImpl.start()

    DevMojo.execute() loop : check pom.xml changes

live reload (hot swap)

  • RuntimeUpdatesProcessor (quarkus 5005)

    VertxHttpHotReplacementSetup -> RuntimeUpdatesProcessor.doScan() -> restart = true ->

                    if (restart) {
                        routingContext.request().headers().set(HEADER_NAME, "true");
                        VertxHttpRecorder.getRootHandler().handle(routingContext.request());
                    }
RuntimeUpdatesProcessor.doScan(boolean) line: 185    
VertxHttpHotReplacementSetup$2.handle(Promise<Boolean>) line: 61  
VertxHttpHotReplacementSetup$2.handle(Object) line: 51  
EventLoopContext(ContextImpl).lambda$executeBlocking$2(PoolMetrics, Object, Handler, Handler) line: 313 
247875749.run() line: not available 
ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker) line: 1128  
ThreadPoolExecutor$Worker.run() line: 628   
FastThreadLocalRunnable.run() line: 30  
VertxThread(Thread).run() line: 834