I'm trying below code on Spring MVC (5.0.8 version of dependencies) deployed on undertow

【client code 】

 InputStreamEntity entity = new InputStreamEntity(inputStream);
        entity.setChunked(true);

 HttpUriRequest post = RequestBuilder
                .post(String.format("http://%s/accessPoint/mirror", serverAddress))
                .addHeader("X-Mirror-Caller", param.getCallFromNumber())
                .addHeader("X-Mirror-Called", param.getCallToNumber())
                .addHeader("X-Mirror-AgentID", param.getAgentId())
                .addHeader("X-Mirror-Direction", param.getCallDirection())
                .addHeader("X-Mirror-CallID", param.getCallId())
                .addHeader("X-Mirror-Source", param.getSource())
                .addHeader("X-Mirror-Extension", param.getExtension())
                .addHeader("X-Mirror-ExtraInfo", param.getExtraInfo())
                .addHeader("X-Mirror-RingTime", StringUtils.formatDateTime(new Date()))
                .addHeader("X-Mirror-ConnectedTime", StringUtils.formatDateTime(new Date()))
                .setEntity(entity)
                .build();

        InetSocketAddress addr = NetUtils.parseSocketAddress(serverAddress);
        HttpHost host = new HttpHost(addr.getAddress(), addr.getPort());

        requester.execute(
                new BasicAsyncRequestProducer(host, post),
                new BasicAsyncResponseConsumer(),
                pool,
                HttpCoreContext.create(),
                new FutureCallback<HttpResponse>() {
                    @Override
                    public void completed(HttpResponse result) {
                        IOUtils.closeQuietly(inputStream);

                        try {
                            RESTfulResponse response = StringUtils.jsonToObject(
                                    new InputStreamReader(
                                            result.getEntity().getContent(), "UTF-8"),
                                    RESTfulResponse.class);
                            if (response == null) {
                                LOG.error("cannot parse response as json" + "agentId = " + agentId
                                        + " file name [ " + speechFile.getName()
                                        + "]" + "call [" + param.getCallId() + "]" + "status code" +
                                        result.getStatusLine().getStatusCode());
                            } else {
                                LOG.info(String.format(
                                        "result of this request is [%s], agentId = %s, source = %s, callId = %s",
                                        response.getFunctionResult(), agentId, source, param.getCallId()));
                            }
                        } catch (Exception e) {
                            LOG.error(e.getMessage(), e);
                        }

                        responseHandler.onResponse(agentId, source);
                    }

                    @Override
                    public void failed(Exception ex) {
                        LOG.error("request failed! agentId = " + agentId
                                + " file name [ " + speechFile.getName()
                                + "]" + "call [" + param.getCallId() + "]", ex);
                        IOUtils.closeQuietly(inputStream);
                        responseHandler.onResponse(agentId, source);
                    }

                    @Override
                    public void cancelled() {
                        LOG.error("request cancelled! agentId = " + agentId);
                        IOUtils.closeQuietly(inputStream);
                        responseHandler.onResponse(agentId, source);
                    }
                });

i can receive first request callback results and results are current but http status code for the second request is 400,when i debug at server, i cannot receive request,The server code is below。

  @ResponseBody
    @RequestMapping(value = "/accessPoint/mirror", method = RequestMethod.POST)
    public DeferredResult<RESTfulResponse> accessNewStream(
            @RequestHeader(name = "X-Mirror-Caller", defaultValue = "") String caller,
            @RequestHeader(name = "X-Mirror-Called", defaultValue = "") String called,
            @RequestHeader(name = "X-Mirror-AgentID", defaultValue = "") String agentId,
            @RequestHeader(name = "X-Mirror-Direction", defaultValue = "") String direction,
            @RequestHeader(name = "X-Mirror-CallID") String callId,
            @RequestHeader(name = "X-Mirror-Source") String streamSource,
            @RequestHeader(name = "X-Mirror-Extension", defaultValue = "") String extension,
            @RequestHeader(name = "X-Mirror-SpeechFormat",
                    defaultValue = "audio/16LE;rate=8000") String format,
            @RequestHeader(name = "X-Mirror-ExtraInfo", defaultValue = "") String extraInfo,
            @RequestHeader(name = "X-Mirror-RingTime") String ringTime,
            @RequestHeader(name = "X-Mirror-ConnectedTime") String connectTime,
            HttpServletRequest request) {
        DeferredResult<RESTfulResponse> result = new DeferredResult<>();
        RESTfulResponse response = new RESTfulResponse();


        LOG.info("Mirror Access stream, agentId=" + agentId + ", callId" + callId);

        if (!StringUtils.isAbsEmpty(agentId)) {
            response.setFunctionResult(CommonErrorString.INVALID_PARAM);
            response.setMessage("agent id is empty");
            // result.setErrorResult(new MirrorAcessException());
            if (!result.isSetOrExpired()) {
                result.setResult(response);
            }
            return result;
        }
        return result;
    }

Comment From: snicoll

Can you please share a small sample that reproduces what you've described. Unfortunately, partial code in text need to be moved to an actual project to be able to debug the issue and we might miss something you haven't shared.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.