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

Get Rid of Cast from ProcessorContext to InternalProcessorContext

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: streams
    • Labels:
      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

              • Assignee:
                Unassigned
                Reporter:
                cadonna Bruno Cadonna
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: