On startup a JP throws
java.net.BindException: Address already in use
A JP starts a Camel route on a socket to listen for agent STOP requests. This route can fail if a socket port is not available.
Change Agent to send SIGTERM signal to JP to force an orderly shutdown instead of sending a STOP request over a dedicated socket channel. with this change, the JP no longer needs to create a Camel route over socket listener. Instead it just needs to catch the SIGTERM signal, quiesce and stop.
The Agent will send SIGKILL (-9) to a process that refuses to stop for SIGTERM.