{"record":{"id":"25cf4a4bfcf55c0f","repo":"Netflix/Hystrix","slug":"not-implemented-anymore-will-be-implemented-in-a-25cf4a","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/SerialHystrixMetric.java","lineNumber":32,"sourceCode":" * limitations under the License.\n */\npackage com.netflix.hystrix.serial;\n\nimport com.fasterxml.jackson.core.JsonFactory;\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport java.nio.ByteBuffer;\n\npublic class SerialHystrixMetric {\n    protected final static JsonFactory jsonFactory = new JsonFactory();\n    protected final static ObjectMapper mapper = new ObjectMapper();\n    protected final static Logger logger = LoggerFactory.getLogger(SerialHystrixMetric.class);\n\n    @Deprecated\n    public static String fromByteBufferToString(ByteBuffer bb) {\n        throw new UnsupportedOperationException(\"Not implemented anymore.  Will be implemented in a new class shortly\");\n    }\n}\n","sourceCodeStart":14,"sourceCodeEnd":35,"githubUrl":"https://github.com/Netflix/Hystrix/blob/5ce3bc58c38e7ca60ef2fe0e516e390e294ad941/hystrix-serialization/src/main/java/com/netflix/hystrix/serial/SerialHystrixMetric.java#L14-L35","documentation":"SerialHystrixMetric.fromByteBufferToString(ByteBuffer) is a deprecated base-class stub that always throws UnsupportedOperationException. It used to decode the custom Hystrix binary metric format (a ByteBuffer produced by the old toBytes pipeline) into a string; the 1.5.x refactor retired that binary format in favor of JSON generators/writers, leaving this decoder without an input format to decode. No subclass overrides it — the throw is the only implementation in the hierarchy.","triggerScenarios":"Invoking SerialHystrixMetric.fromByteBufferToString(bb) (directly or via a subclass reference) on any ByteBuffer. Typical trigger: a consumer that received Hystrix metrics over a socket/queue as byte frames calls this to stringify them, e.g. in a turbine-like or custom aggregation layer, and hits the throw immediately since the method body consists solely of the exception.","commonSituations":"Metric consumers written for the pre-1.5 binary stream format being run against Hystrix 1.5.x; mixed-version clusters where an old producer still emits binary frames and the upgraded consumer tries to decode them; developers assuming fromByteBufferToString is a harmless generic ByteBuffer-to-String utility (it is not — it is format-specific and unimplemented).","solutions":["Stop using the binary format on the producing side: emit JSON via the toJsonString methods (e.g. SerialHystrixDashboardData.toJsonString, SerialHystrixRequestEvents.toJsonString) and send those strings.","On the consuming side, decode bytes as UTF-8 JSON: new String(bytes, StandardCharsets.UTF_8), then parse with a JSON parser instead of this method.","If you must interoperate with a pre-1.5 binary producer, pin the older Hystrix version on the consumer or port the legacy decoding logic into your own code — the library no longer ships it.","Treat @Deprecated on this family of methods as 'will throw' and add compile-time deprecation checks (-Xlint:deprecation) to catch such calls during build."],"exampleFix":"// before\nString metricJson = SerialHystrixMetric.fromByteBuffer(byteBuffer);\n\n// after\nString metricJson = new String(java.nio.charset.StandardCharsets.UTF_8.decode(byteBuffer).array(),\n        java.nio.charset.StandardCharsets.UTF_8); // producer now sends JSON via toJsonString(...)","handlingStrategy":"try-catch","validationCode":"// Validate before decoding: the binary format only existed pre-1.5.\n// Cheap heuristic: pre-1.5 frames are not UTF-8 JSON; if the producer was migrated, the bytes are JSON.\nstatic String decodeMetricFrame(java.nio.ByteBuffer bb) {\n    String s = new String(java.nio.charset.StandardCharsets.UTF_8.decode(bb).array(),\n            java.nio.charset.StandardCharsets.UTF_8);\n    if (s.trim().startsWith(\"{\")) return s;            // JSON frame -> safe\n    throw new IllegalArgumentException(\n        \"Legacy binary Hystrix frame: SerialHystrixMetric.fromByteBufferToString is a stub that always throws; \" +\n        \"producer must send toJsonString output\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    text = SerialHystrixMetric.fromByteBufferToString(bb);\n} catch (UnsupportedOperationException e) {\n    // binary format removed in 1.5.x — treat bytes as UTF-8 JSON instead\n    text = new String(java.nio.charset.StandardCharsets.UTF_8.decode(bb).array(),\n            java.nio.charset.StandardCharsets.UTF_8);\n}","preventionTips":["Do not treat fromByteBufferToString as a generic ByteBuffer utility; it decodes a format the library no longer produces.","Migrate producers and consumers together during a Hystrix 1.5 upgrade so only JSON frames flow through the pipeline.","Enable deprecation warnings as build errors to catch this call at compile time.","Version-pin Hystrix and run the metrics pipeline's integration test after any dependency bump."],"tags":["hystrix","serialization","deprecated-api","bytebuffer","migration","runtime"],"backgroundTag":null,"analyzedSha":"5ce3bc58c38e7ca60ef2fe0e516e390e294ad941","analyzedAt":"2026-08-14T10:55:35.600Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}