.property(OpenTracingFeature.SPAN_CONTEXT_PROPERTY, providedSpan.context()) // <--- span propagation .post(Entity.text("Hello")); .property(OpenTracingFeature.SPAN_CONTEXT_PROPERTY, childSpan.context()) // <--- span propagation .post(Entity.text("World")); childSpan.log("2st Response received from managed client");
builder.headers(newHeaders); builder.property(REQUEST_PROPERTY_FILTER_REUSED, "true");
builder.headers(newHeaders); builder.property(REQUEST_PROPERTY_FILTER_REUSED, "true");
private AsyncInvoker prepareRequest(ForPage forPage, RequestDetails entity, String... additionalPaths) { WebTarget localTarget = prepareTarget(forPage, entity, additionalPaths); Invocation.Builder builder = localTarget.request().accept(MediaType.APPLICATION_JSON_TYPE); if (configuration.getApiToken() != null) { builder = builder.header("X-AUTH-TOKEN", configuration.getApiToken()); } if ((entity != null) && entity.canBeRetried()) { builder = builder.property(RetryConnector.PROPERTY_ENABLE, true); } return builder.async(); }
@Override public ForwardingInvocationBuilder property(String name, Object value) { delegate().property(name, value); return this; }
/** * Test redirection of a timegate request. */ @Test @DisplayName("Test redirection of a timegate request") default void testTimeGateRedirect() { final Instant time = now(); try (final Response res = target(getResourceLocation()).request() .property("jersey.config.client.followRedirects", Boolean.FALSE) .header(ACCEPT_DATETIME, RFC_1123_DATE_TIME.withZone(UTC).format(time)).get()) { assertEquals(REDIRECTION, res.getStatusInfo().getFamily(), "Check for a redirect response"); assertNotNull(res.getLocation(), "Check for a non-null Location header"); } }
@Override public RxBuilder property(String name, Object value) { return new RxBuilder(builder.property(name, value)); }
private <T> Future<Response> invoke(final Request<T> request, final Invocation.Builder builder) { if (Http.Method.PATCH.equals(request.getHttpMethod())) { final AsyncInvoker invoker = builder.async(); builder.property("X-HTTP-Method-Override", "PATCH"); return invoker.method("POST", Entity.json(request.getBodyAsMap())); } else { final AsyncInvoker invoker = builder.async(); return request.hasBody() ? invoker.method(request.getHttpMethod().name(), Entity.json(request.getBodyAsMap())) : invoker.method(request.getHttpMethod().name()); } }
protected void setTimeoutWithTenacity(Invocation.Builder builder) { builder.property(ClientProperties.READ_TIMEOUT, Ints.checkedCast(TenacityCommand .getCommandProperties(tenacityPropertyKey) .executionTimeoutInMilliseconds() .get() + timeoutPadding.toMilliseconds())); }
protected void setTimeoutWithTenacity(Invocation.Builder builder) { builder.property(ClientProperties.READ_TIMEOUT, Ints.checkedCast(TenacityCommand .getCommandProperties(tenacityPropertyKey) .executionTimeoutInMilliseconds() .get() + timeoutPadding.toMilliseconds())); }
@Override public Invocation property(String name, Object value) { invBuilder.property(name, value); return this; }
@Override public Invocation property(String name, Object value) { invBuilder.property(name, value); return this; }
builder.headers(newHeaders); builder.property(REQUEST_PROPERTY_FILTER_REUSED, "true");
/** * Register a request customizer for a single request. * * A registered customizer will be used to customize the underlying Async HTTP Client request builder. * <p> * Invoking this method on an instance that is not configured to use Grizzly Async HTTP Client * connector does not have any effect. * </p> * * @param builder JAX-RS request invocation builder. * @param customizer request customizer to be registered. * @return updated Jersey client config with the Grizzly * {@link org.glassfish.jersey.grizzly.connector.GrizzlyConnectorProvider.RequestCustomizer} attached. */ public static Invocation.Builder register(Invocation.Builder builder, RequestCustomizer customizer) { return builder.property(REQUEST_CUSTOMIZER, customizer); }