Netflix/Hystrix · error · UnsupportedOperationException

Not implemented anymore. Will be implemented in a new class

Error message

Not implemented anymore.  Will be implemented in a new class shortly

What it means

SerialHystrixDashboardData.toBytes(HystrixDashboardStream.DashboardData) is a deprecated stub that always throws UnsupportedOperationException. During the Hystrix 1.5.x serialization refactor, Netflix dropped the custom binary (byte[]) wire format in favor of JSON, and this method was hollowed out pending a rewrite that never landed in this class. The sibling method toJsonString(DashboardData) is the implemented replacement. The exception is unconditional: any call fails at runtime despite the code compiling.

Source

Thrown at hystrix-serialization/src/main/java/com/netflix/hystrix/serial/SerialHystrixDashboardData.java:44

import com.netflix.hystrix.HystrixThreadPoolKey;
import com.netflix.hystrix.HystrixThreadPoolMetrics;
import com.netflix.hystrix.metric.consumer.HystrixDashboardStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rx.functions.Func0;

import java.io.IOException;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;

public class SerialHystrixDashboardData extends SerialHystrixMetric {

    private static final Logger logger = LoggerFactory.getLogger(SerialHystrixDashboardData.class);

    @Deprecated
    public static byte[] toBytes(HystrixDashboardStream.DashboardData dashboardData) {
        throw new UnsupportedOperationException("Not implemented anymore.  Will be implemented in a new class shortly");
    }

    public static String toJsonString(HystrixDashboardStream.DashboardData dashboardData) {
        StringWriter jsonString = new StringWriter();

        try {
            JsonGenerator json = jsonFactory.createGenerator(jsonString);
            writeDashboardData(json, dashboardData);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

        return jsonString.getBuffer().toString();
    }

    public static List<String> toMultipleJsonStrings(HystrixDashboardStream.DashboardData dashboardData) {
        List<String> jsonStrings = new ArrayList<String>();

View on GitHub (pinned to 5ce3bc58c3)

Solutions

  1. Replace the call with SerialHystrixDashboardData.toJsonString(dashboardData) and transmit the JSON string (e.g. getBytes(StandardCharsets.UTF_8)) instead of the binary blob.
  2. If a byte[] is strictly required downstream, serialize the JSON string: dashboardJson.getBytes(StandardCharsets.UTF_8).
  3. Search the codebase for other byte-based serial calls from the same refactor (SerialHystrixRequestEvents.toBytes, SerialHystrixUtilization.toBytes/fromByteBuffer, SerialHystrixMetric.fromByteBufferToString, SerialHystrixConfiguration.toBytes/fromByteBuffer) and migrate them all in one pass.
  4. Enable -Werror=deprecation or deprecation warnings in the build so @Deprecated stubs like this fail (or at least warn) at compile time instead of at runtime.

Example fix

// before
byte[] payload = SerialHystrixDashboardData.toBytes(dashboardData);

// after
byte[] payload = SerialHystrixDashboardData.toJsonString(dashboardData)
        .getBytes(java.nio.charset.StandardCharsets.UTF_8);
Defensive patterns

Strategy: try-catch

Validate before calling

// Reflective guard: refuse to call stubbed serial methods before invoking them.
static boolean isImplemented(Class<?> clazz, String methodName, Class<?>... params) {
    try {
        java.lang.reflect.Method m = clazz.getMethod(methodName, params);
        if (m.getAnnotation(Deprecated.class) == null) return true;
        // deprecated serial stubs in com.netflix.hystrix.serial always throw
        return false;
    } catch (NoSuchMethodException e) {
        return false;
    }
}

if (isImplemented(SerialHystrixDashboardData.class, "toBytes", HystrixDashboardStream.DashboardData.class)) {
    payload = SerialHystrixDashboardData.toBytes(dashboardData);
} else {
    payload = SerialHystrixDashboardData.toJsonString(dashboardData)
            .getBytes(java.nio.charset.StandardCharsets.UTF_8);
}

Try / catch

try {
    payload = SerialHystrixDashboardData.toBytes(dashboardData);
} catch (UnsupportedOperationException e) {
    // deprecated binary stub in Hystrix 1.5.x — fall back to the JSON API
    payload = SerialHystrixDashboardData.toJsonString(dashboardData)
            .getBytes(java.nio.charset.StandardCharsets.UTF_8);
}

Prevention

When it happens

Trigger: Calling the static method SerialHystrixDashboardData.toBytes(dashboardData) with any HystrixDashboardStream.DashboardData argument. This happens when code written against Hystrix < 1.5.0 (or against the old binary-metric pipeline) is recompiled/run against 1.5.x — the method still exists and compiles (it is @Deprecated, not removed), but the very first invocation throws.

Common situations: Upgrading an application or dashboard/turbine consumer from Hystrix 1.4.x to 1.5.x without migrating serialization calls; copy-pasted sample code from old Netflix wiki/blog posts demonstrating byte-array metric publishing; IDE autocomplete picking toBytes over toJsonString because the deprecated method still appears in the API surface; custom metrics sinks that packed DashboardData into byte[] for a message bus.

Related errors


AI-assisted analysis of Netflix/Hystrix@5ce3bc58c3 (2026-08-14). Data as JSON: /api/errors/17c6fd59e9a979e1. Report an issue: GitHub.