You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2025/12/06 17:41:21 UTC

(httpcomponents-core) 01/02: H2 Priority example clean-up

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch 5.4.x
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git

commit 2b5f513d67c15e2f146b481e4c0d2ba2122e302f
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sat Oct 11 21:13:19 2025 +0200

    H2 Priority example clean-up
---
 .../http2/examples/H2RequestExecutionWithPriorityExample.java     | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/examples/H2RequestExecutionWithPriorityExample.java b/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/examples/H2RequestExecutionWithPriorityExample.java
index 53dc597db..36edd41d6 100644
--- a/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/examples/H2RequestExecutionWithPriorityExample.java
+++ b/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/examples/H2RequestExecutionWithPriorityExample.java
@@ -49,15 +49,14 @@
 import org.apache.hc.core5.http2.frame.RawFrame;
 import org.apache.hc.core5.http2.impl.H2Processors;
 import org.apache.hc.core5.http2.impl.nio.H2StreamListener;
+import org.apache.hc.core5.http2.impl.nio.bootstrap.H2RequesterBootstrap;
 import org.apache.hc.core5.http2.priority.PriorityFormatter;
 import org.apache.hc.core5.http2.priority.PriorityValue;
 import org.apache.hc.core5.io.CloseMode;
 import org.apache.hc.core5.util.Timeout;
 
 /**
- * Example: HTTP/2 request that sets RFC 9218 Priority via context and emits the "Priority" header.
- * <p>
- * Requires H2Processors to include H2RequestPriority (client chain) and an HTTP/2 connection.
+ * HTTP/2 request that emits RFC 9218 Priority via "Priority" header.
  */
 @Experimental
 public class H2RequestExecutionWithPriorityExample {
@@ -69,8 +68,7 @@ public static void main(final String[] args) throws Exception {
                 .setPushEnabled(false)
                 .build();
 
-        // Ensure the client processor chain has H2RequestPriority inside (see H2Processors.customClient)
-        final HttpAsyncRequester requester = org.apache.hc.core5.http2.impl.nio.bootstrap.H2RequesterBootstrap.bootstrap()
+        final HttpAsyncRequester requester = H2RequesterBootstrap.bootstrap()
                 .setH2Config(h2Config)
                 .setVersionPolicy(HttpVersionPolicy.FORCE_HTTP_2)
                 .setHttpProcessor(H2Processors.client()) // includes H2RequestPriority