Microprofile allows to define connectionPoolSize from RestClient like this:
io.smallrye.restclient.tests.proxy.HelloClient/property/resteasy.connectionPoolSize = 4
When I set this property in my project, quarkus ignores it. How can i define it?
Microprofile allows to define connectionPoolSize from RestClient like this:
io.smallrye.restclient.tests.proxy.HelloClient/property/resteasy.connectionPoolSize = 4
When I set this property in my project, quarkus ignores it. How can i define it?
package org.myproject.config
public class MyRestClientBuilderListener implements RestClientBuilderListener {
static final Logger LOG = LoggerFactory.getLogger(MgiRestClientBuilderListener.class);
static final String CONNECTION_POOL_SIZE_PROP = "config.restclient.connectionPoolSize";
@Override
public void onNewBuilder(RestClientBuilder builder) {
Config cfg = ConfigProvider.getConfig();
Integer poolSizeConnection = cfg.getValue(CONNECTION_POOL_SIZE_PROP, Integer.class);
if(poolSizeConnection == null) {
poolSizeConnection = 50;//default
}
builder.property("resteasy.connectionPoolSize", poolSizeConnection);
}
}
org.myproject.config.MyRestClientBuilderListener
If your configured client is @RegisterRestClient(configKey="myClient"), to set the pool size use:
quarkus.rest-client.myClient.connection-pool-size: 5
(...and not myClient/mp-rest/connectionPoolSize)