0

I am noticing 307 redirect working only for Get calls in jetty httpclient. For Post/Put redirection are not happening when body present with request.

We are using jetty-client:11.0.11

Update 1 I did poc code to try out the put post calls with httpclient over http2 and was getting response properly.

As in my actual use case we are using Spring webclient + httpclient over http2 , I need to check if that is somehow causing the problem. As of this point no issue with httpclient library.

Update 2 I was able to recreate the issue with Spring Webclient + jetty httpclient and getting below exception Multiple subscriptions not supported on AsyncRequestContent

Also this exception is not coming if we are not sending body with the POST/PUT request.

Code snippets below

build.gradle dependencies added

implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'com.darylteo.gradle:javassist-plugin:0.4.1'
implementation 'commons-codec:commons-codec'
implementation 'org.eclipse.jetty:jetty-http:11.0.11'   
implementation 'org.eclipse.jetty.http2:http2-http-client-transport:11.0.11'
implementation 'org.eclipse.jetty:jetty-client:11.0.11'
implementation 'org.eclipse.jetty.http2:http2-client:11.0.11'
implementation 'org.eclipse.jetty:jetty-alpn-client:11.0.11'
implementation 'org.eclipse.jetty:jetty-io:11.0.11'
implementation 'org.eclipse.jetty:jetty-util:11.0.11'   
implementation 'org.eclipse.jetty:jetty-alpn-java-client:11.0.11'   
implementation 'org.eclipse.jetty.http2:http2-common:11.0.11' 
implementation 'org.eclipse.jetty.http2:http2-hpack:11.0.11'
implementation 'org.eclipse.jetty:jetty-reactive-httpclient:3.0.6'

HttpClient over http2transport

private HttpClient httpClient;

@PostConstruct
public HttpClient jettyClient(){
    
    SslContextFactory.Client sslClient = new SslContextFactory.Client(true);
    ClientConnector connector = new ClientConnector();
    connector.setSslContextFactory(sslClient);
    
    HTTP2Client http2Client = new HTTP2Client(connector);
    
    HttpClientTransportOverHTTP2 transportOverHTTP2 = new HttpClientTransportOverHTTP2(http2Client);
            
    httpClient = new HttpClient(transportOverHTTP2);
    httpClient.setFollowRedirects(true);
    
    try {
        httpClient.start();
    } catch (Exception e) {
        e.printStackTrace();
    }
    
    return httpClient;      
}

public HttpClient getHttpClient() {return httpClient;}

RestController

@Value("${sleepTime}")
long sleep;
@Value("${errorCode}")
int errorCode;

@Autowired
Http2Client http2Client;

@RequestMapping("**")
public ResponseEntity<byte[]> post_greet(RequestEntity<byte[]> requestEntity) throws InterruptedException{
    System.out.println("Inside Post greet****");
    
    HttpHeaders httpHeaders = requestEntity.getHeaders();
    System.out.println("uri:"+ requestEntity.getUrl());
    System.out.println("content-type:" + httpHeaders.getContentType());
    System.out.println("content-length:" + httpHeaders.getContentLength());
    
    MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
    headers.addAll(requestEntity.getHeaders());

    Thread.sleep(sleep);
    
    headers.remove("accept-encoding");
    headers.remove("user-agent");
    headers.remove("accept");
    headers.remove("content-length");
    
    System.out.println("Exit Post greet****");

    return new ResponseEntity<byte[]>(requestEntity.getBody(),headers,HttpStatus.OK);
}

@RequestMapping(value = "/redirect")
public Mono<ResponseEntity<byte[]>> redirect(RequestEntity<byte[]> requestEntity){
    System.out.println("Got request now redirecting****");

    MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
    headers.add("Location", "http://localhost:8787/redirect-url");
    
    return Mono.just(new ResponseEntity<>(headers,HttpStatus.TEMPORARY_REDIRECT));
}   


@GetMapping(value = "/start")
public Mono<ResponseEntity<byte[]>> start(RequestEntity<byte[]> requestEntity) 
        throws InterruptedException, TimeoutException, ExecutionException{
    System.out.println("JettyClient start call****");
    
    ClientHttpConnector clientConnector =
            new JettyClientHttpConnector(http2Client.getHttpClient()); 
    WebClient webClient = WebClient.builder()
            .clientConnector(clientConnector)
            .build();

    Mono<ResponseEntity<byte[]>> monoResponse = webClient
     .method(HttpMethod.POST)
     .uri("http://localhost:8787/redirect")
     .headers(hdrs->hdrs.add("Content-Type", "application/json"))
     .body(BodyInserters.fromValue("\"greetings\":\"Hello Mr Andersen\""))
     .exchange()
     .flatMap(clientResponse->{
         System.out.println("WebClient response code :: " +clientResponse.statusCode());
         return clientResponse.toEntity(byte[].class);
     })
     .onErrorResume(WebClientException.class,clientResponse->{
         System.out.println("Exception is :: " + clientResponse.getLocalizedMessage());
         ResponseEntity<byte[]> response = new ResponseEntity<byte[]>("Exception occured".getBytes(StandardCharsets.UTF_8),HttpStatus.INTERNAL_SERVER_ERROR);
         return Mono.just(response);
     })
     .doOnCancel(()->System.out.println("Request was cancelled"));

    MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
    headers.addAll(requestEntity.getHeaders());
    headers.remove("accept-encoding");
    headers.remove("user-agent");
    headers.remove("accept");
    headers.remove("content-length");
    
    System.out.println("JettyClient start end****");

    return monoResponse;
}

Logs attached below

2022-10-20 09:28:02.149  INFO 7992 --- [           main] com.example.demo.StubserverApplication   : Started StubserverApplication in 1.829 seconds (JVM running for 2.198)
JettyClient start call****
JettyClient start end****
Got request now redirecting****

Exception is :: Multiple subscriptions not supported on 
AsyncRequestContent@49b1a991[demand=0,stalled=true,chunks=0]; nested 
exception is java.lang.IllegalStateException: Multiple subscriptions not 
supported on 
AsyncRequestContent@49b1a991[demand=0,stalled=true,chunks=0]

Flows working

  1. Httpclient only (reactive)
Request request = http2Client.getClient().newRequest("http://localhost:8787/redirect").method(HttpMethod.POST); 
request.body(new StringRequestContent("\"greetings\":\"Hello Mr Andersen\"")).headers(s->s.add(HttpHeader.CONTENT_TYPE, "application/json"));
ReactiveRequest reactiveRequest = ReactiveRequest.newBuilder(request).build();
Publisher<ReactiveResponse> publisher = reactiveRequest.response();
  1. Httpclient only (non reactive)
 ContentResponse response =
         http2Client.getClient().POST("http://localhost:8787/redirect"). content(new
         StringContentProvider("\"greetings\":\"Hello Mr Andersen\""),
         "application/json").send();

Flow not working

  1. Httpclient with Spring webclient reactive
ClientHttpConnector clientConnector =
                new JettyClientHttpConnector(http2Client.getHttpClient()); 
        WebClient webClient = WebClient.builder()
                .clientConnector(clientConnector)
                .build();
    
        Mono<ResponseEntity<byte[]>> monoResponse = webClient
         .method(HttpMethod.POST)...

LOGS

2022-10-26 22:33:52.715 DEBUG 10808 --- [ctor-http-nio-3] o.s.w.s.adapter.HttpWebHandlerAdapter    : [5d46ae80/1-2] HTTP POST "/redirect"
2022-10-26 22:33:52.722 DEBUG 10808 --- [ctor-http-nio-3] s.w.r.r.m.a.RequestMappingHandlerMapping : [5d46ae80/1-2] Mapped to com.example.demo.ServerController#redirect(RequestEntity)
2022-10-26 22:33:52.722 DEBUG 10808 --- [ctor-http-nio-3] r.r.m.a.HttpEntityMethodArgumentResolver : [5d46ae80/1-2] Content-Type:application/json
2022-10-26 22:33:52.722 DEBUG 10808 --- [ctor-http-nio-3] r.r.m.a.HttpEntityMethodArgumentResolver : [5d46ae80/1-2] 0..1 [byte[]]
2022-10-26 22:33:52.726 DEBUG 10808 --- [ctor-http-nio-3] o.s.core.codec.ByteArrayDecoder          : [5d46ae80/1-2] Read 31 bytes
2022-10-26 22:33:52.730 DEBUG 10808 --- [ctor-http-nio-3] o.s.w.s.adapter.HttpWebHandlerAdapter    : [5d46ae80/1-2] Completed 307 TEMPORARY_REDIRECT
2022-10-26 22:33:52.739 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.io.ManagedSelector     : Selector sun.nio.ch.WEPollSelectorImpl@2962d398 woken up from select, 1/1/1 selected
2022-10-26 22:33:52.739 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.io.ManagedSelector     : Selector sun.nio.ch.WEPollSelectorImpl@2962d398 processing 1 keys, 0 updates
2022-10-26 22:33:52.740 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.io.ManagedSelector     : selected 1 channel=java.nio.channels.SocketChannel[connected local=/127.0.0.1:62033 remote=localhost/127.0.0.1:8787], selector=sun.nio.ch.WEPollSelectorImpl@2962d398, interestOps=1, readyOps=1 SocketChannelEndPoint@321dd779[{l=/127.0.0.1:62033,r=localhost/127.0.0.1:8787,OPEN,fill=FI,flush=-,to=44/30000}{io=1/1,kio=1,kro=1}]->[HTTP2ClientConnection@2a930f0e]
2022-10-26 22:33:52.741 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.io.SelectableChannelEndPoint   : onSelected 1->0 r=true w=false for SocketChannelEndPoint@321dd779[{l=/127.0.0.1:62033,r=localhost/127.0.0.1:8787,OPEN,fill=FI,flush=-,to=45/30000}{io=1/0,kio=1,kro=1}]->[HTTP2ClientConnection@2a930f0e]
2022-10-26 22:33:52.741 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.io.SelectableChannelEndPoint   : task SocketChannelEndPoint@321dd779[{l=/127.0.0.1:62033,r=localhost/127.0.0.1:8787,OPEN,fill=FI,flush=-,to=45/30000}{io=1/0,kio=1,kro=1}]->[HTTP2ClientConnection@2a930f0e]:runFillable:EITHER
2022-10-26 22:33:52.741 DEBUG 10808 --- [ient@eadd4fb-20] o.e.j.u.thread.ReservedThreadExecutor    : ReservedThreadExecutor@3688eb5b{reserved=0/4,pending=0} tryExecute org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy$$Lambda$482/0x0000000800f16ca0@1424c3b3
2022-10-26 22:33:52.742 DEBUG 10808 --- [ient@eadd4fb-20] o.e.j.u.thread.ReservedThreadExecutor    : ReservedThreadExecutor@3688eb5b{reserved=0/4,pending=1} startReservedThread p=1
2022-10-26 22:33:52.742 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.util.thread.QueuedThreadPool   : queue ReservedThread@7abbbb35{PENDING,thread=null} startThread=0
2022-10-26 22:33:52.742 DEBUG 10808 --- [ient@eadd4fb-20] o.e.j.u.t.s.AdaptiveExecutionStrategy    : ss=PRODUCE_INVOKE_CONSUME t=SocketChannelEndPoint@321dd779[{l=/127.0.0.1:62033,r=localhost/127.0.0.1:8787,OPEN,fill=FI,flush=-,to=47/30000}{io=1/0,kio=1,kro=1}]->[HTTP2ClientConnection@2a930f0e]:runFillable:EITHER/EITHER AdaptiveExecutionStrategy@1b75c2e3/SelectorProducer@1984b1f/PRODUCING/p=false/QueuedThreadPool[HttpClient@eadd4fb]@f1da57d{STARTED,8<=8<=200,i=6,r=-1,q=0}[ReservedThreadExecutor@3688eb5b{reserved=0/4,pending=1}][pc=0,pic=0,pec=0,epc=0]@2022-10-26T22:33:52.7434704+05:30
2022-10-26 22:33:52.742 DEBUG 10808 --- [ient@eadd4fb-22] o.e.jetty.util.thread.QueuedThreadPool   : run ReservedThread@7abbbb35{PENDING,thread=null} in QueuedThreadPool[HttpClient@eadd4fb]@f1da57d{STARTED,8<=8<=200,i=6,r=-1,q=0}[ReservedThreadExecutor@3688eb5b{reserved=0/4,pending=1}]
2022-10-26 22:33:52.743 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.io.FillInterest        : fillable FillInterest@36fdedce{org.eclipse.jetty.http2.HTTP2Connection$FillableCallback@60296b33}
2022-10-26 22:33:52.745 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.http2.HTTP2Connection  : HTTP2 onFillable HTTP2ClientConnection@2a930f0e::SocketChannelEndPoint@321dd779[{l=/127.0.0.1:62033,r=localhost/127.0.0.1:8787,OPEN,fill=-,flush=-,to=49/30000}{io=1/0,kio=1,kro=1}]->[HTTP2ClientConnection@2a930f0e]
2022-10-26 22:33:52.745 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.http2.HTTP2Connection  : HTTP2 produce HTTP2ClientConnection@2a930f0e::SocketChannelEndPoint@321dd779[{l=/127.0.0.1:62033,r=localhost/127.0.0.1:8787,OPEN,fill=-,flush=-,to=49/30000}{io=1/0,kio=1,kro=1}]->[HTTP2ClientConnection@2a930f0e]
2022-10-26 22:33:52.746 DEBUG 10808 --- [ient@eadd4fb-20] o.e.j.u.t.s.AdaptiveExecutionStrategy    : AdaptiveExecutionStrategy@17f16706/HTTP2Producer@480486a2/IDLE/p=false/QueuedThreadPool[HttpClient@eadd4fb]@f1da57d{STARTED,8<=8<=200,i=6,r=-1,q=0}[ReservedThreadExecutor@3688eb5b{reserved=1/4,pending=0}][pc=0,pic=0,pec=0,epc=0]@2022-10-26T22:33:52.7460585+05:30 tryProduce false
2022-10-26 22:33:52.746 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.http2.HTTP2Connection  : Dequeued task null
2022-10-26 22:33:52.746 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.http2.HTTP2Connection  : Acquired org.eclipse.jetty.http2.HTTP2Connection$NetworkBuffer@4830c68a
2022-10-26 22:33:52.747 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.io.SocketChannelEndPoint       : filled 53 DirectByteBuffer@771ad687[p=0,l=53,c=16384,r=53]={<<<\x00\x00,\x01\x05\x00\x00\x00\x01H\x03307n"http://lo...st:8787/redirect-url\\\x010>>>\r\x82d?S\x83\xF9c\xE7...\x00\x00\x00\x00\x00\x00\x00}
2022-10-26 22:33:52.745 DEBUG 10808 --- [ient@eadd4fb-22] o.e.j.u.thread.ReservedThreadExecutor    : ReservedThread@7abbbb35{PENDING,thread=Thread[HttpClient@eadd4fb-22,5,main]} was=PENDING next=RESERVED size=0+1 capacity=4
2022-10-26 22:33:52.751 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.http2.HTTP2Connection  : Filled 53 bytes in org.eclipse.jetty.http2.HTTP2Connection$NetworkBuffer@4830c68a
2022-10-26 22:33:52.752 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.http2.parser.Parser    : Parsed [HEADERS|44|5|1] frame header from java.nio.DirectByteBuffer[pos=9 lim=53 cap=16384]@d81b37ff
2022-10-26 22:33:52.752 DEBUG 10808 --- [ient@eadd4fb-22] o.e.j.u.thread.ReservedThreadExecutor    : ReservedThread@7abbbb35{RESERVED,thread=Thread[HttpClient@eadd4fb-22,5,main]} waiting ReservedThreadExecutor@3688eb5b{reserved=1/4,pending=0}
2022-10-26 22:33:52.754 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.http2.hpack.HpackDecoder       : CtxTbl[ee9c664] decoding 44 octets
2022-10-26 22:33:52.754 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.http2.hpack.HpackDecoder       : decode 48033330376e22687474703a2f2f6c6f63616c686f73743a383738372f72656469726563742d75726c5c0130
2022-10-26 22:33:52.755 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.http2.hpack.HpackDecoder       : decoded ':status: 307' by IdxName/LitVal/Idx
2022-10-26 22:33:52.756 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.http2.hpack.HpackContext       : HdrTbl[ee9c664] added {D,0,:status: 307,44a38f23}
2022-10-26 22:33:52.756 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.http2.hpack.HpackContext       : HdrTbl[ee9c664] entries=1, size=42, max=4096
2022-10-26 22:33:52.757 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.http2.hpack.HpackDecoder       : decode 6e22687474703a2f2f6c6f63616c686f73743a383738372f72656469726563742d75726c5c0130
2022-10-26 22:33:52.757 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.http2.hpack.HpackDecoder       : decoded 'location: http://localhost:8787/redirect-url' by IdxName/LitVal/Idx
2022-10-26 22:33:52.757 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.http2.hpack.HpackContext       : HdrTbl[ee9c664] added {D,1,location: http://localhost:8787/redirect-url,247b2db0}
2022-10-26 22:33:52.758 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.http2.hpack.HpackContext       : HdrTbl[ee9c664] entries=2, size=116, max=4096
2022-10-26 22:33:52.758 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.http2.hpack.HpackDecoder       : decode 5c0130
2022-10-26 22:33:52.758 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.http2.hpack.HpackDecoder       : decoded 'Content-Length: 0' by IdxName/LitVal/Idx
2022-10-26 22:33:52.758 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.http2.hpack.HpackContext       : HdrTbl[ee9c664] added {D,2,Content-Length: 0,5ee2c293}
2022-10-26 22:33:52.759 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.http2.hpack.HpackContext       : HdrTbl[ee9c664] entries=3, size=163, max=4096
2022-10-26 22:33:52.759 DEBUG 10808 --- [ient@eadd4fb-20] o.eclipse.jetty.http2.parser.BodyParser  : Parsed HEADERS frame hpack from java.nio.DirectByteBuffer[pos=53 lim=53 cap=16384]
2022-10-26 22:33:52.759 DEBUG 10808 --- [ient@eadd4fb-20] o.e.j.http2.client.HTTP2ClientSession    : Received HeadersFrame@43014c4d#1{end=true}
2022-10-26 22:33:52.760 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.http2.HTTP2Stream      : Update close for HTTP2Stream@54bc89e6#1@6384107{sendWindow=65504,recvWindow=8388608,demand=0,reset=false/false,LOCALLY_CLOSED,age=106,attachment=HttpReceiverOverHTTP2@88410f7(rsp=IDLE,failure=null)} update=true event=RECEIVED
2022-10-26 22:33:52.760 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.http2.HTTP2Session     : Removed local HTTP2Stream@54bc89e6#1@6384107{sendWindow=65504,recvWindow=8388608,demand=0,reset=false/false,CLOSED,age=107,attachment=HttpReceiverOverHTTP2@88410f7(rsp=IDLE,failure=null)} from HTTP2ClientSession@6384107{local:/127.0.0.1:62033,remote:localhost/127.0.0.1:8787,sendWindow=65504,recvWindow=16777216,state=[streams=1,NOT_CLOSED,goAwayRecv=null,goAwaySent=null,failure=null]}
2022-10-26 22:33:52.760 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.http2.HTTP2Session     : Closed stream HTTP2Stream@54bc89e6#1@6384107{sendWindow=65504,recvWindow=8388608,demand=0,reset=false/false,CLOSED,age=107,attachment=HttpReceiverOverHTTP2@88410f7(rsp=IDLE,failure=null)} for HTTP2ClientSession@6384107{local:/127.0.0.1:62033,remote:localhost/127.0.0.1:8787,sendWindow=65504,recvWindow=16777216,state=[streams=1,NOT_CLOSED,goAwayRecv=null,goAwaySent=null,failure=null]}
2022-10-26 22:33:52.761 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.http2.HTTP2Session     : Destroyed stream #1 for HTTP2ClientSession@6384107{local:/127.0.0.1:62033,remote:localhost/127.0.0.1:8787,sendWindow=65504,recvWindow=16777216,state=[streams=1,NOT_CLOSED,goAwayRecv=null,goAwaySent=null,failure=null]}
2022-10-26 22:33:52.769 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.client.HttpReceiver    : Response HttpResponse[HTTP/2.0 307 null]@79d6a430 found protocol handler org.eclipse.jetty.client.RedirectProtocolHandler@3e6aef30
2022-10-26 22:33:52.769 DEBUG 10808 --- [ient@eadd4fb-20] o.eclipse.jetty.client.HttpConversation  : Exchanges in conversation 1, override=org.eclipse.jetty.client.RedirectProtocolHandler@3e6aef30, listeners=[org.eclipse.jetty.client.RedirectProtocolHandler@3e6aef30]
2022-10-26 22:33:52.770 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.client.HttpReceiver    : Response begin HttpResponse[HTTP/2.0 307 null]@79d6a430
2022-10-26 22:33:52.772 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.client.HttpReceiver    : Response headers HttpResponse[HTTP/2.0 307 null]@79d6a430
2022-10-26 22:33:52.773 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.client.HttpReceiver    : Response demand=1/1, resume=false
2022-10-26 22:33:52.773 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.client.HttpReceiver    : Response headers hasDemand=true HttpResponse[HTTP/2.0 307 null]@79d6a430
2022-10-26 22:33:52.774 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.client.HttpReceiver    : Response success HttpResponse[HTTP/2.0 307 null]@79d6a430
2022-10-26 22:33:52.775 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.client.HttpExchange    : Terminated response for HttpExchange@40d70396{req=HttpRequest[POST /redirect HTTP/2.0]@7e536042[TERMINATED/null] res=HttpResponse[HTTP/2.0 307 null]@79d6a430[TERMINATED/null]}, result: Result[HttpRequest[POST /redirect HTTP/2.0]@7e536042 > HttpResponse[HTTP/2.0 307 null]@79d6a430] null
2022-10-26 22:33:52.775 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.client.HttpReceiver    : Response complete HttpResponse[HTTP/2.0 307 null]@79d6a430, result: Result[HttpRequest[POST /redirect HTTP/2.0]@7e536042 > HttpResponse[HTTP/2.0 307 null]@79d6a430] null
2022-10-26 22:33:52.776 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.client.HttpChannel     : HttpExchange@40d70396{req=HttpRequest[POST /redirect HTTP/2.0]@7e536042[TERMINATED/null] res=HttpResponse[HTTP/2.0 307 null]@79d6a430[TERMINATED/null]} disassociated true from HttpChannelOverHTTP2@7a176a5e(exchange=null)[send=HttpSenderOverHTTP2@7fca75e4(req=QUEUED,failure=null),recv=HttpReceiverOverHTTP2@88410f7(rsp=IDLE,failure=null)]
2022-10-26 22:33:52.776 DEBUG 10808 --- [ient@eadd4fb-20] o.e.j.h.c.http.HttpChannelOverHTTP2      : exchange terminated Result[HttpRequest[POST /redirect HTTP/2.0]@7e536042 > HttpResponse[HTTP/2.0 307 null]@79d6a430] null HTTP2Stream@54bc89e6#1@6384107{sendWindow=65504,recvWindow=8388608,demand=0,reset=false/false,CLOSED,age=123,attachment=HttpReceiverOverHTTP2@88410f7(rsp=IDLE,failure=null)}
2022-10-26 22:33:52.776 DEBUG 10808 --- [ient@eadd4fb-20] o.e.j.h.c.http.HttpConnectionOverHTTP2   : Released HttpChannelOverHTTP2@7a176a5e(exchange=null)[send=HttpSenderOverHTTP2@7fca75e4(req=QUEUED,failure=null),recv=HttpReceiverOverHTTP2@88410f7(rsp=IDLE,failure=null)]
2022-10-26 22:33:52.777 DEBUG 10808 --- [ient@eadd4fb-20] o.e.j.h.c.http.HttpChannelOverHTTP2      : released channel? true HttpChannelOverHTTP2@7a176a5e(exchange=null)[send=HttpSenderOverHTTP2@7fca75e4(req=QUEUED,failure=null),recv=HttpReceiverOverHTTP2@88410f7(rsp=IDLE,failure=null)]
2022-10-26 22:33:52.777 DEBUG 10808 --- [ient@eadd4fb-20] o.eclipse.jetty.client.HttpDestination   : Released HttpConnectionOverHTTP2@3ee779f7(closed=false)[HTTP2ClientSession@6384107{local:/127.0.0.1:62033,remote:localhost/127.0.0.1:8787,sendWindow=65504,recvWindow=16777216,state=[streams=0,NOT_CLOSED,goAwayRecv=null,goAwaySent=null,failure=null]}]
2022-10-26 22:33:52.777 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.client.AbstractConnectionPool  : Released (true) MultiEntry@66ffcba0{IDLE,usage=1,multiplex=0,pooled=HttpConnectionOverHTTP2@3ee779f7(closed=false)[HTTP2ClientSession@6384107{local:/127.0.0.1:62033,remote:localhost/127.0.0.1:8787,sendWindow=65504,recvWindow=16777216,state=[streams=0,NOT_CLOSED,goAwayRecv=null,goAwaySent=null,failure=null]}]} @66ab6845[inUse=0,size=1,max=64,closed=false]
2022-10-26 22:33:52.778 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.client.HttpReceiver    : Request/Response succeeded: Result[HttpRequest[POST /redirect HTTP/2.0]@7e536042 > HttpResponse[HTTP/2.0 307 null]@79d6a430] null, notifying [org.eclipse.jetty.client.RedirectProtocolHandler@3e6aef30]
2022-10-26 22:33:52.778 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.client.HttpRedirector  : Redirecting to http://localhost:8787/redirect-url (Location: http://localhost:8787/redirect-url)
2022-10-26 22:33:52.779 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.client.HttpClient      : Resolved HttpDestination[Origin@d3c73938[http://localhost:8787,tag=null,protocol=Protocol@301a9e[proto=[h2c],nego=false]]]@c02e444,queue=0,pool=MultiplexConnectionPool@2ac1c8a2[c=0/1/64,a=0,i=1,q=0] for HttpRequest[POST /redirect-url HTTP/2.0]@5b096284
2022-10-26 22:33:52.779 DEBUG 10808 --- [ient@eadd4fb-20] o.eclipse.jetty.client.HttpConversation  : Exchanges in conversation 2, override=null, listeners=[org.eclipse.jetty.client.HttpRequest$8@7e7a4c19, org.eclipse.jetty.client.HttpRequest$8@1c010dcb, org.eclipse.jetty.client.HttpRequest$10@7b322008, org.eclipse.jetty.client.HttpRequest$13@4ebbf3c, org.eclipse.jetty.client.HttpRequest$14@285d313c, org.eclipse.jetty.client.HttpRequest$15@3c260ea9, org.eclipse.jetty.client.HttpRequest$16@567e5b45, ResponseListenerProcessor@5ab8943f[Reactive[HttpRequest[POST /redirect HTTP/2.0]@7e536042]]]
2022-10-26 22:33:52.780 DEBUG 10808 --- [ient@eadd4fb-20] o.eclipse.jetty.client.HttpDestination   : Queued HttpRequest[POST /redirect-url HTTP/2.0]@5b096284 for HttpDestination[Origin@d3c73938[http://localhost:8787,tag=null,protocol=Protocol@301a9e[proto=[h2c],nego=false]]]@c02e444,queue=1,pool=MultiplexConnectionPool@2ac1c8a2[c=0/1/64,a=0,i=1,q=1]
2022-10-26 22:33:52.780 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.client.AbstractConnectionPool  : Acquiring create=true on MultiplexConnectionPool@2ac1c8a2[c=0/1/64,a=0,i=1,q=1]
2022-10-26 22:33:52.780 DEBUG 10808 --- [ient@eadd4fb-20] o.e.jetty.client.AbstractConnectionPool  : Activated MultiEntry@66ffcba0{ACTIVE,usage=2,multiplex=1,pooled=HttpConnectionOverHTTP2@3ee779f7(closed=false)[HTTP2ClientSession@6384107{local:/127.0.0.1:62033,remote:localhost/127.0.0.1:8787,sendWindow=65504,recvWindow=16777216,state=[streams=0,NOT_CLOSED,goAwayRecv=null,goAwaySent=null,failure=null]}]} @66ab6845[inUse=1,size=1,max=64,closed=false]
2022-10-26 22:33:52.781 DEBUG 10808 --- [ient@eadd4fb-20] o.eclipse.jetty.client.HttpDestination   : Processing exchange HttpExchange@3586e5e5{req=HttpRequest[POST /redirect-url HTTP/2.0]@5b096284[PENDING/null] res=HttpResponse[null 0 null]@64221408[PENDING/null]} on HttpConnectionOverHTTP2@3ee779f7(closed=false)[HTTP2ClientSession@6384107{local:/127.0.0.1:62033,remote:localhost/127.0.0.1:8787,sendWindow=65504,recvWindow=16777216,state=[streams=0,NOT_CLOSED,goAwayRecv=null,goAwaySent=null,failure=null]}] of HttpDestination[Origin@d3c73938[http://localhost:8787,tag=null,protocol=Protocol@301a9e[proto=[h2c],nego=false]]]@c02e444,queue=0,pool=MultiplexConnectionPool@2ac1c8a2[c=0/1/64,a=1,i=0,q=0]
2022-10-26 22:33:52.781 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.client.HttpConnection  : Normalizing true HttpRequest[POST /redirect-url HTTP/2.0]@5b096284
2022-10-26 22:33:52.782 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.client.HttpChannel     : HttpExchange@3586e5e5{req=HttpRequest[POST /redirect-url HTTP/2.0]@5b096284[PENDING/null] res=HttpResponse[null 0 null]@64221408[PENDING/null]} associated true to HttpChannelOverHTTP2@7a176a5e(exchange=HttpExchange@3586e5e5{req=HttpRequest[POST /redirect-url HTTP/2.0]@5b096284[PENDING/null] res=HttpResponse[null 0 null]@64221408[PENDING/null]})[send=HttpSenderOverHTTP2@7fca75e4(req=QUEUED,failure=null),recv=HttpReceiverOverHTTP2@88410f7(rsp=IDLE,failure=null)]
2022-10-26 22:33:52.782 DEBUG 10808 --- [ient@eadd4fb-20] org.eclipse.jetty.client.HttpSender      : Request begin HttpRequest[POST /redirect-url HTTP/2.0]@5b096284
2022-10-26 22:33:52.783 DEBUG 10808 --- [ient@eadd4fb-20] o.eclipse.jetty.client.HttpConversation  : Exchanges in conversation 2, override=null, listeners=[org.eclipse.jetty.client.HttpRequest$8@7e7a4c19, org.eclipse.jetty.client.HttpRequest$8@1c010dcb, org.eclipse.jetty.client.HttpRequest$10@7b322008, org.eclipse.jetty.client.HttpRequest$13@4ebbf3c, org.eclipse.jetty.client.HttpRequest$14@285d313c, org.eclipse.jetty.client.HttpRequest$15@3c260ea9, org.eclipse.jetty.client.HttpRequest$16@567e5b45, ResponseListenerProcessor@5ab8943f[Reactive[HttpRequest[POST /redirect HTTP/2.0]@7e536042]]]
2022-10-26 22:33:52.787 DEBUG 10808 --- [ient@eadd4fb-20] o.e.j.r.c.i.ResponseListenerProcessor    : response failure HttpResponse[HTTP/2.0 307 null]@79d6a430 on ResponseListenerProcessor@5ab8943f[Reactive[HttpRequest[POST /redirect HTTP/2.0]@7e536042]]

java.lang.IllegalStateException: Multiple subscriptions not supported on AsyncRequestContent@289f2284[demand=0,stalled=true,chunks=0]
        at org.eclipse.jetty.client.util.AsyncRequestContent.subscribe(AsyncRequestContent.java:83) ~[jetty-client-11.0.11.jar!/:11.0.11]
        at org.eclipse.jetty.reactive.client.internal.PublisherRequestContent.subscribe(PublisherRequestContent.java:47) ~[jetty-reactive-httpclient-3.0.6.jar!/:na]
        at org.eclipse.jetty.client.HttpSender.queuedToBegin(HttpSender.java:106) ~[jetty-client-11.0.11.jar!/:11.0.11]
        at org.eclipse.jetty.client.HttpSender.send(HttpSender.java:77) ~[jetty-client-11.0.11.jar!/:11.0.11]
        at org.eclipse.jetty.http2.client.http.HttpChannelOverHTTP2.send(HttpChannelOverHTTP2.java:102) ~[http2-http-client-transport-11.0.11.jar!/:11.0.11]
        at org.eclipse.jetty.client.HttpChannel.send(HttpChannel.java:122) ~[jetty-client-11.0.11.jar!/:11.0.11]
        at org.eclipse.jetty.client.HttpConnection.send(HttpConnection.java:110) ~[jetty-client-11.0.11.jar!/:11.0.11]
        at org.eclipse.jetty.http2.client.http.HttpConnectionOverHTTP2.send(HttpConnectionOverHTTP2.java:104) ~[http2-http-client-transport-11.0.11.jar!/:11.0.11]
        at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:382) ~[jetty-client-11.0.11.jar!/:11.0.11]
        at org.eclipse.jetty.client.HttpDestination.process(HttpDestination.java:358) ~[jetty-client-11.0.11.jar!/:11.0.11]
        at org.eclipse.jetty.client.HttpDestination.process(HttpDestination.java:313) ~[jetty-client-11.0.11.jar!/:11.0.11]
        at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:296) ~[jetty-client-11.0.11.jar!/:11.0.11]
        at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:290) ~[jetty-client-11.0.11.jar!/:11.0.11]
        at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:267) ~[jetty-client-11.0.11.jar!/:11.0.11]
        at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:247) ~[jetty-client-11.0.11.jar!/:11.0.11]
SKR
  • 103
  • 1
  • 10
  • There is an open issue about this reported recently - https://github.com/eclipse/jetty.project/issues/8724 - Eclipse Jetty devs have not been able to replicate and are seeking more information – Joakim Erdfelt Oct 19 '22 at 11:45
  • Thank you, I followed your test cases and tested the calls myself also with httpclient over http2transport and was getting response fine. – SKR Oct 19 '22 at 20:36

0 Answers0