Class RedisStreamIT

    • Field Detail

      • dbHostname

        String dbHostname
      • dbPassword

        String dbPassword
      • jedis

        protected static redis.clients.jedis.Jedis jedis
    • Constructor Detail

      • RedisStreamIT

        public RedisStreamIT()
    • Method Detail

      • setupDependencies

        void setupDependencies​(@Observes
                               io.debezium.server.events.ConnectorStartedEvent event)
      • connectorCompleted

        void connectorCompleted​(@Observes
                                io.debezium.server.events.ConnectorCompletedEvent event)
                         throws Exception
        Throws:
        Exception
      • getStreamLength

        private Long getStreamLength​(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 10 records to it 3. Then, delete all the records in this table and expect the stream to contain 30 records (10 inserted before + 20 as result of this deletion including the tombstone events) 4. Insert 22 records to redis_test2 table and sleep for 1 second to simulate Redis OOM 5. Delete the stream and expect those 22 records to be inserted to it as there's enough memory to complete this operation
        Throws:
        Exception