Class RedisStreamIT

java.lang.Object
io.debezium.server.redis.RedisStreamIT

@QuarkusTestResource(RedisTestResourceLifecycleManager.class) public class RedisStreamIT extends Object
Integration tests that verify basic reading from PostgreSQL database and writing to Redis stream and retry mechanism in case of connectivity issues or OOM in Redis
Author:
M Sazzadul Hoque, Yossi Shirizli
  • Constructor Details

    • RedisStreamIT

      public RedisStreamIT()
  • Method Details

    • getPostgresConnection

      private PostgresConnection getPostgresConnection()
    • getStreamLength

      private Long getStreamLength(redis.clients.jedis.Jedis jedis, String streamName, int expectedLength)
    • testRedisStream

      @Test public void testRedisStream() throws Exception
      Verifies that all the records of a PostgreSQL table are streamed to Redis
      Throws:
      Exception
    • testRedisConnectionRetry

      @Test @FixFor("DBZ-4510") public void testRedisConnectionRetry() throws Exception
      Test retry mechanism when encountering Redis connectivity issues: 1. Make Redis to be unavailable while the server is up 2. Create a new table named redis_test in PostgreSQL and insert 5 records to it 3. Bring Redis up again and make sure these records have been streamed successfully
      Throws:
      Exception
    • testRedisOOMRetry

      @Test @FixFor("DBZ-4510") public void testRedisOOMRetry() throws Exception
      Test retry mechanism when encountering Redis Out of Memory: 1. Simulate a Redis OOM by setting its max memory to 1M 2. Create a new table named redis_test2 in PostgreSQL and insert 50 records to it 3. Sleep for 1 second to simulate Redis OOM (stream does not contain 50 records) 4. Unlimit memory and verify that all 50 records have been streamed
      Throws:
      Exception