{"record":{"id":"7073c3d8f9fb8b67","repo":"Netflix/Hystrix","slug":"not-implemented-anymore-will-be-implemented-in-a-7073c3","errorCode":null,"errorMessage":"Not implemented anymore.  Will be implemented in a new class shortly","messagePattern":"Not implemented anymore\\.  Will be implemented in a new class shortly","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hystrix-serialization/src/main/java/com/netflix/hystrix/serial/SerialHystrixUtilization.java","lineNumber":38,"sourceCode":"import com.netflix.hystrix.HystrixThreadPoolKey;\nimport com.netflix.hystrix.metric.sample.HystrixCommandUtilization;\nimport com.netflix.hystrix.metric.sample.HystrixThreadPoolUtilization;\nimport com.netflix.hystrix.metric.sample.HystrixUtilization;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport java.io.IOException;\nimport java.io.StringWriter;\nimport java.nio.ByteBuffer;\nimport java.util.Map;\n\npublic class SerialHystrixUtilization extends SerialHystrixMetric {\n\n    private final static Logger logger = LoggerFactory.getLogger(SerialHystrixUtilization.class);\n\n    @Deprecated\n    public static byte[] toBytes(HystrixUtilization utilization) {\n        throw new UnsupportedOperationException(\"Not implemented anymore.  Will be implemented in a new class shortly\");\n    }\n\n    public static String toJsonString(HystrixUtilization utilization) {\n        StringWriter jsonString = new StringWriter();\n\n        try {\n            JsonGenerator json = jsonFactory.createGenerator(jsonString);\n\n            serializeUtilization(utilization, json);\n        } catch (Exception e) {\n            throw new RuntimeException(e);\n        }\n\n        return jsonString.getBuffer().toString();\n    }\n\n    private static void serializeUtilization(HystrixUtilization utilization, JsonGenerator json) {\n        try {","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/Netflix/Hystrix/blob/5ce3bc58c38e7ca60ef2fe0e516e390e294ad941/hystrix-serialization/src/main/java/com/netflix/hystrix/serial/SerialHystrixUtilization.java#L20-L56","documentation":"SerialHystrixUtilization.toBytes(HystrixUtilization) is a deprecated stub whose entire body is 'throw new UnsupportedOperationException(...)'. HystrixUtilization snapshots command and thread-pool concurrency (activeCount, queueSize) for the utilization stream; in the 1.5.x serialization refactor its wire format became JSON (see the implemented toJsonString and writeThreadPoolUtilizationJson helpers in the same file), and the binary encoder was removed pending a replacement class that never arrived.","triggerScenarios":"Invoking SerialHystrixUtilization.toBytes(utilization), typically from a custom metrics publisher that ships utilization snapshots as byte frames to a collector. The method exists on the public API surface, so the code compiles and then throws on the first utilization tick (these publishers usually run on a scheduled thread, so the exception appears in scheduled-task logs).","commonSituations":"Upgrading a monitoring/publisher integration from Hystrix 1.4.x to 1.5.x; reusing Netflix-era example publishers (metric-publisher samples) that chose byte[] for compactness; a scheduler swallowing the exception and silently producing no utilization data, making the failure look like a metrics outage rather than an API error.","solutions":["Use SerialHystrixUtilization.toJsonString(utilization) and publish the JSON string (or its UTF-8 bytes).","If the transport needs byte[], wrap the JSON: toJsonString(utilization).getBytes(StandardCharsets.UTF_8).","Audit the publisher for the sibling stub fromByteBuffer(ByteBuffer) in the same class (line 84) and the equivalent stubs in SerialHystrixConfiguration/SerialHystrixDashboardData/SerialHystrixRequestEvents — migrate them together.","Make scheduled publisher tasks log-and-continue on exceptions so an API stub like this is visible immediately, not after noticing missing data."],"exampleFix":"// before\nbyte[] frame = SerialHystrixUtilization.toBytes(utilization);\n\n// after\nbyte[] frame = SerialHystrixUtilization.toJsonString(utilization)\n        .getBytes(java.nio.charset.StandardCharsets.UTF_8);","handlingStrategy":"try-catch","validationCode":"// Publisher-side check before emitting a utilization frame.\nstatic byte[] frame(HystrixUtilization utilization) {\n    return SerialHystrixUtilization.toJsonString(utilization)\n            .getBytes(java.nio.charset.StandardCharsets.UTF_8); // only implemented path\n}","typeGuard":null,"tryCatchPattern":"try {\n    frame = SerialHystrixUtilization.toBytes(utilization);\n} catch (UnsupportedOperationException e) {\n    frame = SerialHystrixUtilization.toJsonString(utilization)\n            .getBytes(java.nio.charset.StandardCharsets.UTF_8);\n}","preventionTips":["In scheduled publisher tasks, catch and log exceptions per tick so a stubbed API shows up as an immediate error, not as silently missing metrics.","Migrate publishers to toJsonString during the 1.5 upgrade; the binary encoder/decoder pair is entirely stubbed out.","Build with -Werror=deprecation to block calls to @Deprecated serial methods.","Add a smoke test that publishes one utilization frame after dependency upgrades."],"tags":["hystrix","serialization","deprecated-api","metrics-publisher","migration","runtime"],"backgroundTag":null,"analyzedSha":"5ce3bc58c38e7ca60ef2fe0e516e390e294ad941","analyzedAt":"2026-08-14T10:55:35.600Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}