Brian
Brian

Reputation: 616

How to configure connection pool for Riak

I am trying to configure my riak connector similar to how I did my Datasource Service connector. (source below is from: https://cloud.spring.io/spring-cloud-connectors/spring-cloud-spring-service-connector.html)

@Bean
public DataSource dataSource() {
    PoolConfig poolConfig = new PoolConfig(5, 30, 3000);
    DataSourceConfig dbConfig = new DataSourceConfig(poolConfig, null);
    return connectionFactory().dataSource("my-own-personal-sql", dbConfig);
}

How would I configure my pools size for riak in spring cloud?

Thanks, Brian

Upvotes: 0

Views: 130

Answers (1)

Daniel Mikusa
Daniel Mikusa

Reputation: 15006

I don't believe that Spring Cloud Connectors has support for Riak out of the box (at least not at the time of me writing this). See the list of supported connectors here.

You would need to follow the instructions here to add support for a custom service.


I would suggest taking a look at java-cfenv instead though. It's really intended to replace SCC and doesn't need to strictly support every service type that you want to connect to. It has generic ways of pulling the config that you need. It's also designed to integrate better with Spring Boot, if you're using that.

https://spring.io/blog/2019/02/15/introducing-java-cfenv-a-new-library-for-accessing-cloud-foundry-services

Hope that helps!

Upvotes: 1

Related Questions