Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-9109

Get Rid of Cast from ProcessorContext to InternalProcessorContext

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • streams
    • None

    Description

      The following cast is often used in Kafka Streams code.

      public void init(final ProcessorContext context) {
          internalProcessorContext = (InternalProcessorContext) context;
          ...
      }
      

      This code leads to a ClassCastException if the implementation of the ProcessorContext is not an InternalProcessorContext, which defeats the purpose of using interface ProcessorContext in the API.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cadonna Bruno Cadonna
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: