Class WireFormatException

All Implemented Interfaces:
Serializable

public class WireFormatException extends RuntimeException
Thrown by WireFormatCodec when on-wire bytes do not satisfy the declared WireFormat (e.g. byte array shorter than the required prefix length, or Confluent magic byte != 0x00).

Unchecked because the wire-format violations originate from network / Kafka broker data plane, where the surrounding consumer loop already needs a generic exception handler — making this a checked exception would force callers to write try/catch blocks they cannot recover from in any useful way. See rule 2 (error-handling) — propagate to the level that can meaningfully handle the failure, which in this case is the Kafka consumer loop's error handler.

See Also:
  • Constructor Details

    • WireFormatException

      public WireFormatException(String message)
      Parameters:
      message - human-readable description of the format violation
    • WireFormatException

      public WireFormatException(String message, Throwable cause)
      Parameters:
      message - human-readable description of the format violation
      cause - the wrapped lower-level cause (e.g. a JVM IndexOutOfBoundsException from a manual byte slice that races a malformed input)