danny
danny

Reputation: 11

it always show Remotely Closed when I use ning's async-http-client jar

it always call onThrowable method ,and show "Remotely Closed [id: 0x00366573, /192.168.86.196:55246 :> /10.45.5.166:8080]" if submitData's value very long,and submitData's value is json form .

        ObtainSubmitInfo obtainSubmitInfo = new ObtainSubmitInfo();
    String submitData =  obtainSubmitInfo.getUserJsonData(null);
    System.out.println("Danny-----submitData::"+submitData);
    AsyncHttpClientConfig.Builder builder = new AsyncHttpClientConfig.Builder();
    builder.setMaximumConnectionsTotal(10000);
    AsyncHttpClient asyncHttpClient = new AsyncHttpClient(builder.build());
    Request request = asyncHttpClient.preparePost(RequestUtility.RequestURL.SUBMIT_USER_TASK_DATA_URL)
            .setHeader("Content-Type","application/json")
            .addQueryParameter(RequestUtility.LoginParmJsonKey.DTS_INPUT , submitData).build();
    asyncHttpClient.executeRequest(request, new AsyncCompletionHandler<Response>() {

        @Override
        public Response onCompleted(Response response) throws Exception {
            System.out.println("response--:"+response.getResponseBody());
            return null;
        }

        @Override
        public void onThrowable(Throwable t) {
            System.out.println("response------:"+t.getMessage());
            super.onThrowable(t);
        }

    });

Upvotes: 1

Views: 575

Answers (0)

Related Questions