Class DemoDatabasePollingService

java.lang.Object
com.maybeitssquid.rotatingsecrets.DemoDatabasePollingService

@Service public class DemoDatabasePollingService extends Object
Demonstrates database connectivity by polling the database on scheduled intervals.

Runs two polling threads that check out connections from the pool, execute a simple query, and print results to stdout. This exercises the connection pool and credential rotation behavior.

  • Constructor Details

    • DemoDatabasePollingService

      public DemoDatabasePollingService(DataSource dataSource)
      Creates the polling service with the given DataSource.
      Parameters:
      dataSource - the connection pool to use for queries
  • Method Details

    • pollSlow

      @Scheduled(fixedRateString="${demo.polling.interval.slow:5000}") public void pollSlow()
      Polls the database at the slow interval (default: every 5 seconds).
    • pollFast

      @Scheduled(fixedRateString="${demo.polling.interval.fast:3000}") public void pollFast()
      Polls the database at the fast interval (default: every 3 seconds).