HttpClientRequest setTimeout

70 views
Skip to first unread message

Fernando Jordán Silva

unread,
Jun 18, 2013, 5:22:17 AM6/18/13
to ve...@googlegroups.com
Hi

I'm trying to use the method setTimeout when sending a POST request from an HttpClient object, but I get an error: NosuchMethod.
The stange thing is that method is defined and is public.

This is my code:

HttpClient client = vertx
        .createHttpClient()
        .setHost(config.getString(HOST))
        .setPort(config.getInteger(PORT))
        .setKeepAlive(true)
        .setConnectTimeout(config.getInteger(TIMEOUT));
HttpClientRequest clientRequest = client.post(endpoint, new ResponseHandler());
clientRequest.setTimeout(5*1000L);   // Exception: NoSuchMethod !!

What am I doing wrong ?

Thanks for your help.

j2ro

unread,
Jun 18, 2013, 9:44:06 AM6/18/13
to ve...@googlegroups.com
Are vertx library versions that you are compiling with the same as the ones that you are trying to run against?

For example, are you building your module against Vertx 1.3.1 and trying to run in Vertx 2.0.0?

Tim Fox

unread,
Jun 18, 2013, 9:45:04 AM6/18/13
to ve...@googlegroups.com
Impossible to say by just looking at a code snippet.

Almost certainly you are using an old version of Vert.x before the
setTimeout() method was introduced.

Fernando Jordán Silva

unread,
Jun 18, 2013, 3:31:37 PM6/18/13
to ve...@googlegroups.com
You are right, that was the point. 

newbie mistake. Thank you for your help.
Reply all
Reply to author
Forward
0 new messages