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

Configure java agent for cloud remote debugging and set env var JAVA_OPTIONS_TOOL #17581

Closed
cmoulliard opened this issue Jun 1, 2021 · 2 comments · Fixed by #24104
Closed

Comments

@cmoulliard
Copy link

cmoulliard commented Jun 1, 2021

Description

I propose that we provide a new parameter/property able to configure the following ENV var for Cloud deployment of an application (and maybe for local remote debugging as syntax changes with JDK).

quarkus.kubernetes.env-vars.JAVA_TOOL_OPTIONS.value=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:5005

We should offer the possibility for the user too to:

  • Enable or disable the suspend=y|n argument,
  • Specify the external port to be used to access remotely the application (e.g. nodePort: 31000)
  • Specify the url when they will use an ingress or openshift route if that works using such resource !!! (to be investigated)

Why ?

  • Without such an ENV var included within the Kubernetes Deployment generated by the Quarkus Kubernetes/Openshift extensions, it is needed that the user configure (= edit the file) manually before to deploy the kubernetes YAML/JSON resources
  • The syntax of the javaagent to be configured is different between the JDK as described here https://dzone.com/articles/remote-debugging-java-applications-with-jdwp
  • User does not know what should tbe the ENV VAR to be passed to the JDK container image as image used could be different between JIB, Buildpacks, S2I builds
@quarkus-bot
Copy link

quarkus-bot bot commented Jun 1, 2021

/cc @geoand

@iocanel
Copy link
Contributor

iocanel commented Jun 1, 2021

+1

gsmet pushed a commit to gsmet/quarkus that referenced this issue Jun 10, 2021
Sgitario added a commit to Sgitario/quarkus that referenced this issue Mar 4, 2022
This PR allows to easily configure the remote debugging and describes how to do this in the documentation.

I've also tried to expose another route to map the java agent port, but as intellij could handle this port from localhost (it threw a handshake error), I decided to not over-complicate this guide and simple do the port-forward bit (see my changes in documentation).

Fix quarkusio#17581
Fix quarkusio#23765
Sgitario added a commit to Sgitario/quarkus that referenced this issue Mar 7, 2022
This PR allows to easily configure the remote debugging and describes how to do this in the documentation.

I've also tried to expose another route to map the java agent port, but as intellij could handle this port from localhost (it threw a handshake error), I decided to not over-complicate this guide and simple do the port-forward bit (see my changes in documentation).

Fix quarkusio#17581
Fix quarkusio#23765
Sgitario added a commit to Sgitario/quarkus that referenced this issue Mar 22, 2022
This PR allows to easily configure the remote debugging and describes how to do this in the documentation.

I've also tried to expose another route to map the java agent port, but as intellij could handle this port from localhost (it threw a handshake error), I decided to not over-complicate this guide and simple do the port-forward bit (see my changes in documentation).

Fix quarkusio#17581
Fix quarkusio#23765
@quarkus-bot quarkus-bot bot added this to the 2.8 - main milestone Mar 23, 2022
@gsmet gsmet modified the milestones: 2.8.0.CR1, 2.8.0.Final Mar 28, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Mar 28, 2022
This PR allows to easily configure the remote debugging and describes how to do this in the documentation.

I've also tried to expose another route to map the java agent port, but as intellij could handle this port from localhost (it threw a handshake error), I decided to not over-complicate this guide and simple do the port-forward bit (see my changes in documentation).

Fix quarkusio#17581
Fix quarkusio#23765

(cherry picked from commit 14dd231)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants