4. 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.

YAML:

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
 

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
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.-
maxRetriesfalse2Total number of connection attempts before giving up. This includes the first attempt, so 5 means 1 try + 4 retries. Used for failover and load balancing logic.3
useExperimentalHttp2falsefalseEnables experimental support for HTTP/2. When true, HTTP/2 connections are attempted when possible.-

Child Elements

ElementDescriptionCardinality
authenticationConfiguration for basic HTTP authentication. This element can be used to configure credentials for outbound requests requiring HTTP Basic Auth. Typically used within . XML Example: YAML (experimental): authentication: username: user password: secret0..1
connectionConfiguration for low-level socket behavior of Membrane's HTTP client. This includes timeouts and local address binding for outbound connections. Typically used as a child of . XML Example: YAML (experimental):0..1
proxyConfiguration for an outbound HTTP proxy. Defines the address, optional authentication credentials, and TLS configuration for connecting to a proxy. Can be used as a child element in to route client connections through a proxy server. XML Example: YAML (experimental): proxy: host: proxy.example.com port: 3128 authentication: true username: user password: secret ssl: keystoreLocation: classpath:proxy-client.jks keystorePassword: changeit0..1
sslConfigures inbound or outbound SSL connections.0..1

Can be used in