HttpClient unable to handle 100 continue??

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

HttpClient unable to handle 100 continue??

This post was updated on .
I am new to ratpack. As part of the ratpack app we have an endpoint which makes a call to REST endpoint using HttpClient. The endpoint actually flow to F5 load balancer -> apache -> application.

While testing the ratpack endpoint, few requests will just work fine and all of a sudden http client will receive 100 from REST endpoint. when this happens ratpack request will timeout based on the timeout setting we have.

Here is the source code, Not sure if implementation is proper or not

class IdValidationsResource extends GroovyChainAction {

    public static final String TOKEN_ID_VALIDATION_ENDPOINT = "/validation/id_validations"

    ValidationsService validationsService

    void execute() {
        def chain = post {
            ValidationsServiceConfig validationsServiceConfig = context.get(ValidationsServiceConfig)
            def proxyUri = URI.create(validationsServiceConfig.tokenServiceBaseUrlOrVip
                    + TOKEN_ID_VALIDATION_ENDPOINT)

            request.body.then {
                byte[] bytes = it.bytes;
      'Proxying call for token id validation: {}', new String(bytes))
                validationsService.httpClient.request(proxyUri) { RequestSpec spec ->
                    spec.headers.add("Content-Type", "application/json")
                } onError {
                    log.error("exception in processing the request : ", it)
                    render(Jackson.json(["message": "failed to proxy the id validation"]))
                } then { ReceivedResponse receivedResponse ->
          "Proxy response status for token id validation : {} ", receivedResponse.statusCode) //here is where i see an 100 continue at times

Any help would be much appreciated. Thanks in advance