Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-5534

EmbeddedEngine should initialize Connector using SourceConnectorContext

XMLWordPrintable

    • False
    • None
    • False

      In order to make your issue reports as actionable as possible, please provide the following information, depending on the issue type.

      Bug report

      For bug reports, provide this information, please:

      What Debezium connector do you use and what version?

      vitess connector

      What is the connector configuration?

      Not relevant

      What is the captured database version and mode of depoyment?

      AWS

      What behaviour do you expect?

      SourceConnector#context() method should return SourceConnectorContext 

      What behaviour do you see?

      ClassCastException: EmbeddedEngine#2 cannot be cast to SourceConnectorContext

      Do you see the same behaviour using the latest relesead Debezium version?

      Yes

      Do you have the connector logs, ideally from start till finish?

      (You might be asked later to provide DEBUG/TRACE level log)

      <Your answer>

      How to reproduce the issue using our tutorial deployment?

      In the integration tests, create a Connector object and then call connector.context() method, you will see ClassCastException

       

      For the integration tests for all connectors in debezium, we are using EmbeddedEngine to simulate the Kafka Connect runtime.  However initialize the connector with ConnectorContext instead of SourceConnectorContext: https://github.com/debezium/debezium/blob/main/debezium-embedded/src/main/java/io/debezium/embedded/EmbeddedEngine.java#L711

      But all the connectors extended from RelationalBaseSourceConnector which extends from SourceConnector, for SourceConnector we expect a SourceConnectorContext object returned from context() method call.

      Since EmbededEngine initialize the connector with the wrong ConnectorContext object, we cannot invoke connector.context() method without seeing a ClassCastException.

      Please initialize the connector with the correct SourceConnectorContext which will provide the access to OffsetStorageReader, we want to access OffsetStorageReader from connector in integration tests.

      This bug affects both the integration test environment as well as other environments which uses EmbeddedEngine.

       

      Feature request or enhancement

      For feature requests or enhancements, provide this information, please:

      Which use case/requirement will be addressed by the proposed feature?

      <Your answer>

      Implementation ideas (optional)

      <Your answer>

            Unassigned Unassigned
            haiyingcai Henry Haiying Cai (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: