7. Transports and Clients

httpClientConfig

Version

Configuration container for Membrane's HTTP client. Allows defining proxy, connection, authentication, TLS, and retry behavior. Can be used as a reusable bean and referenced via <spring:bean>. Most of its sub-elements are optional.
httpClientConfig:
adjustHostHeader: true
connection:
timeout: 10000
proxy:
host: proxy.example.com
port: 3128
authentication:
type: basic
user: user
password: pass
ssl:
keystoreLocation: classpath:client.jks
keystorePassword: secret
httpClientConfig:
   adjustHostHeader: true
   connection:
     timeout: 10000
   proxy:
     host: proxy.example.com
     port: 3128
   authentication:
     type: basic
     user: user
     password: pass
   ssl:
     keystoreLocation: classpath:client.jks
     keystorePassword: secret

Syntax

httpClientConfig:
'$ref': <string>
adjustHostHeader: <boolean>
authentication: {}
connection: {}
proxy: {}
retries: {}
ssl: {}
useExperimentalHttp2: <boolean>
httpClientConfig:
  '$ref': <string>
  adjustHostHeader: <boolean>
  authentication: {}
  connection: {}
  proxy: {}
  retries: {}
  ssl: {}
  useExperimentalHttp2: <boolean>

Sample

<httpClientConfig maxRetries="5" adjustHostHeader="true">
<connection timeout="10000"/>
<proxy host="proxy.example.com" port="3128"/>
<authentication type="basic" user="user" password="pass"/>
<ssl keystoreLocation="classpath:client.jks" keystorePassword="secret"/>
</httpClientConfig>
<httpClientConfig maxRetries="5" adjustHostHeader="true">
    <connection timeout="10000"/>
    <proxy host="proxy.example.com" port="3128"/>
    <authentication type="basic" user="user" password="pass"/>
    <ssl keystoreLocation="classpath:client.jks" keystorePassword="secret"/>
</httpClientConfig>

Attributes

NameRequiredDefaultDescriptionExamples
$reffalse-Reference a component defined under components.-
adjustHostHeaderfalsetrueWhether to automatically rewrite the Host header to match the target address. This is useful when routing requests to internal systems where the Host header must match the backend.-
useExperimentalHttp2falsefalseEnables experimental support for HTTP/2. When true, HTTP/2 connections are attempted when possible.-

Child Structure

ElementCardinalityDescription
authentication0..1Optional authentication mechanism (e.g., basic auth).
connection0..1Connection-related configuration such as timeouts and connection pooling. Cannot be null.
proxy-configuration0..1Optional proxy configuration for outbound connections.
retries0..1
ssl0..1Configures inbound or outbound SSL connections.

Can be used in