sge
sge

Reputation: 728

How to confgure the PGProperty TCP_KEEP_ALIVE that is available at HikariConfig

How do I configure the property value that tcpkeepalive value is set to true?

I already tried

spring:
  datasource:
    connection-properties: tcpKeepAlive=true
    connectionproperties: tcpKeepAlive=true

However, without success.

HikariConfig does contain a Properties object, but how has the values be defined in the yml file that they are loaded there?

Upvotes: 2

Views: 2174

Answers (1)

Mark Rotteveel
Mark Rotteveel

Reputation: 109079

Assuming this property is a connection property of the driver, you need to configure the dataSourceProperties property on hikari. You can do this like:

spring:
  datasource:
    hikari:
      data-source-properties:
        tcpKeepAlive: true

Alternatively, you could include the properties in the spring.datasource.url property.

Upvotes: 4

Related Questions