Reputation: 1
We are using Spring XD for executing some batch jobs and considering to use Spring Cloud Dataflow. For this I wanted to remote debug a execution of a Task and I was not able to make it working.
I tried to export the following environment variable before the SCDF server is started:
spring.cloud.deployer.local.javaOpts=Xdebug -Xrunjdwp:transport=dt_socket,address=12201,server=y
Also tried to pass as argument in the GUI while invoking the task:
app.<appname>.local.javaOpts=Xdebug -Xrunjdwp:transport=dt_socket,address=12201,server=y
Nothing seems to be working.
Upvotes: 0
Views: 1224
Reputation: 1
Finally I was able to remote debug a composed task or regular task. Follow the below steps:
You can now see in the log that when the composed task's java process is launched it is called with the debug parameter.
If you want to control the heap memory or any java options you can do by adding the following property: deployer.composed-task-runner.local.javaOpts=Xmx2048M Note that 'composed-task-runner' is the name of the App (Not the name of the task).
Upvotes: 0
Reputation: 1869
I'm able to debug the composed-task-runner
launched by SCDF using the listen
debugger mode, this will also work for your task as well.
5006
. (this project's classpath should have composed-task-runner
sources, put break point some where )-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
option, attach debugger to the SCDF process in your IDE on port 5005 (attach mode).
String javaOptsString = getValue(deploymentProperties, "javaOpts");
in JavaCommandBuilder
class (for spring-cloud-deployer-local
v.1.3.0.M2 it's line #83).Step Over once in your IDE, the value of javaOptsString
is null
now. Using IDE, set the value of javaOptsString
to
-agentlib:jdwp=transport=dt_socket,server=n,address=localhost:5006,suspend=y
Press Resume
in IDE.
If you know how to pass javaOpts
as deployment properties of your task - you will be able to debug in listen mode without this nightmare ;-). I've not found a way to escape =
and ,
characters in the -agentlib:jdwp=transport=dt_socket,server=n,address=localhost:5006,suspend=y
javaOpts deployment property.
Upvotes: 1
Reputation: 5651
We are working on an improved solution for the local-deployer - you can follow spring-cloud/spring-cloud-dataflow#369 for tracking purpose.
There is, however, the following option that exists to aggregate all the application logs into the server console directly, which might be useful while in active development.
stream deploy --name myStream --properties "deployer.*.local.inheritLogging=true"
Upvotes: 0