{"record":{"id":"837958c46e2b9679","repo":"Netflix/Hystrix","slug":"not-implemented-anymore-will-be-implemented-in-a-837958","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/SerialHystrixRequestEvents.java","lineNumber":32,"sourceCode":" * limitations under the License.\n */\npackage com.netflix.hystrix.serial;\n\nimport com.fasterxml.jackson.core.JsonGenerator;\nimport com.netflix.hystrix.ExecutionResult;\nimport com.netflix.hystrix.HystrixEventType;\nimport com.netflix.hystrix.metric.HystrixRequestEvents;\n\nimport java.io.IOException;\nimport java.io.StringWriter;\nimport java.util.List;\nimport java.util.Map;\n\npublic class SerialHystrixRequestEvents extends SerialHystrixMetric {\n\n    @Deprecated\n    public static byte[] toBytes(HystrixRequestEvents requestEvents) {\n        throw new UnsupportedOperationException(\"Not implemented anymore.  Will be implemented in a new class shortly\");\n    }\n\n    public static String toJsonString(HystrixRequestEvents requestEvents) {\n        StringWriter jsonString = new StringWriter();\n\n        try {\n            JsonGenerator json = jsonFactory.createGenerator(jsonString);\n\n            serializeRequestEvents(requestEvents, json);\n        } catch (Exception e) {\n            throw new RuntimeException(e);\n        }\n\n        return jsonString.getBuffer().toString();\n    }\n\n    private static void serializeRequestEvents(HystrixRequestEvents requestEvents, JsonGenerator json) {\n        try {","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/Netflix/Hystrix/blob/5ce3bc58c38e7ca60ef2fe0e516e390e294ad941/hystrix-serialization/src/main/java/com/netflix/hystrix/serial/SerialHystrixRequestEvents.java#L14-L50","documentation":"SerialHystrixRequestEvents.toBytes(HystrixRequestEvents) is a deprecated stub that unconditionally throws UnsupportedOperationException. Hystrix request-event data (per-request command executions and emitted event counts, used by the request-log servlet and hystrix-request-servlet samples) moved to a JSON representation in 1.5.x, and the binary encoder was deleted. The implemented path in the same class is toJsonString(HystrixRequestEvents), which writes via a JsonGenerator.","triggerScenarios":"Calling SerialHystrixRequestEvents.toBytes(requestEvents) — e.g. a request-log persistor or audit layer that stored per-request event blobs as byte arrays. Because the method signature still exists and compiles, the failure surfaces only at runtime on first call, for every request that reaches that code path.","commonSituations":"Porting a request-log/auditing extension from Hystrix 1.4 to 1.5+; following old documentation or blog examples that serialized HystrixRequestEvents to byte[] for storage in Redis/Kafka/files; teams adding request-event persistence for the first time and picking the byte-array overload from IDE suggestions without noticing @Deprecated.","solutions":["Switch to SerialHystrixRequestEvents.toJsonString(requestEvents) and store/transmit the JSON string.","If byte[] storage is required, encode the JSON string: toJsonString(requestEvents).getBytes(StandardCharsets.UTF_8).","Verify no other serial classes in the same call chain still use the removed binary API (grep for toBytes(/fromByteBuffer( against com.netflix.hystrix.serial).","Turn deprecation warnings into build errors so this class of latent runtime failure is caught at compile time."],"exampleFix":"// before\nbyte[] blob = SerialHystrixRequestEvents.toBytes(requestEvents);\n\n// after\nbyte[] blob = SerialHystrixRequestEvents.toJsonString(requestEvents)\n        .getBytes(java.nio.charset.StandardCharsets.UTF_8);","handlingStrategy":"try-catch","validationCode":"// Route request-event persistence through the implemented JSON API only.\nstatic String persist(HystrixRequestEvents events) {\n    return SerialHystrixRequestEvents.toJsonString(events); // never call toBytes()\n}","typeGuard":null,"tryCatchPattern":"try {\n    blob = SerialHystrixRequestEvents.toBytes(requestEvents);\n} catch (UnsupportedOperationException e) {\n    blob = SerialHystrixRequestEvents.toJsonString(requestEvents)\n            .getBytes(java.nio.charset.StandardCharsets.UTF_8);\n}","preventionTips":["Use toJsonString for HystrixRequestEvents persistence; the byte[] overload is a guaranteed throw in 1.5.x.","Check the Hystrix release notes / migration guide (1.4 -> 1.5) before upgrading projects that serialize request logs.","Compile with deprecation-as-error so the @Deprecated stub cannot slip through.","Cover request-event persistence with a unit test that exercises the serialization call once — the stub fails on first invocation, so one test catches it."],"tags":["hystrix","serialization","deprecated-api","request-log","migration","runtime"],"backgroundTag":null,"analyzedSha":"5ce3bc58c38e7ca60ef2fe0e516e390e294ad941","analyzedAt":"2026-08-14T10:55:35.600Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}