[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [hono-dev] How to debug Hono-code
|
On Wed, 2018-04-11 at 23:14 +0200, Alfusainey Jallow wrote:
> Hi Kai & hono-devs,
>
> I need some help. I am trying to step-through the http adapter code using the
> eclipse built-in debugger. I want to see internally what happens when a http
> client tries to upload telemetry data (from the point when the client made the
> request until the point where the AMQP 1.0 message is sent to the telemetry
> endpoint).
>
> The test case am considering is
> testPostTelemetrySucceedsForValidCredentials(...) of the
> VertxBasedHttpProtocolAdapterTest
>
> The problem that I am facing is that the debugger times out and as a result
> terminates after a short time. During setting up the adapter, I tried doing the
> ff:
>
> 1. Using Long.MAX_VALUE as the max value for the event-loop execution time
> > VertxOptions options = new
> > VertxOptions().setMaxEventLoopExecuteTime(Long.MAX_VALUE);
> > vertx = Vertx.vertx(options);
> > ...
>
> 2. Set the adapter as a worker thread:
> > vertx.deployVerticle(httpAdapter, new DeploymentOptions().setWorker(true),
> > ctx.asyncAssertSuccess());
>
> In both setups, the debugger times out before i reach the
> AbstractVertxBasedHttpProtocolAdapter#doUploadMessage(..) method
>
> How can I work around this problem so that I have a lot of time before the
> debugger times out? how do you debug hono code?
>
I do not think that running the adapter on a worker thread helps a lot. The
problem is more likely to be related to the test case itself timing out.
The VertxBasedHttpProtocolAdapterTest test class defines a Timeout rule at the
top of the class which defines a timout period of 5 seconds for each test case.
You may try to increase this value to e.g. 60 seconds in order for the test case
to not time out prematurely before you were able to inspect your breakpoints ...
Let me know if that works for you ...
> kind regards
> --
> alfu