{"record":{"id":"92baed1d8624569f","repo":"dotnet/aspnetcore","slug":"the-message-type-s-is-not-supported-yet-92baed","errorCode":null,"errorMessage":"The message type %s is not supported yet.","messagePattern":"The message type (.+?) is not supported yet\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"src/SignalR/clients/java/signalr/core/src/main/java/com/microsoft/signalr/HubConnection.java","lineNumber":527,"sourceCode":"                        continue;\n                    }\n                    irq.complete(completionMessage);\n                    break;\n                case STREAM_ITEM:\n                    StreamItem streamItem = (StreamItem)message;\n                    InvocationRequest streamInvocationRequest = connectionState.getInvocation(streamItem.getInvocationId());\n                    if (streamInvocationRequest == null) {\n                        logger.warn(\"Dropped unsolicited Completion message for invocation '{}'.\", streamItem.getInvocationId());\n                        continue;\n                    }\n\n                    streamInvocationRequest.addItem(streamItem);\n                    break;\n                case STREAM_INVOCATION:\n                case CANCEL_INVOCATION:\n                    logger.error(\"This client does not support {} messages.\", message.getMessageType());\n\n                    throw new UnsupportedOperationException(String.format(\"The message type %s is not supported yet.\", message.getMessageType()));\n            }\n        }\n    }\n\n    /**\n     * Stops a connection to the server.\n     *\n     * @return A Completable that completes when the connection has been stopped.\n     */\n    public Completable stop() {\n        return stop(null);\n    }\n\n    private void stopConnection(String errorMessage) {\n        RuntimeException exception = null;\n        this.state.lock();\n        try {\n            ConnectionState connectionState = this.state.getConnectionStateUnsynchronized(true);","sourceCodeStart":509,"sourceCodeEnd":545,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/294cab2f9b2e03af6b953820c7ab497c3c8b7ad9/src/SignalR/clients/java/signalr/core/src/main/java/com/microsoft/signalr/HubConnection.java#L509-L545","documentation":"An UnsupportedOperationException thrown by ReceiveLoop when an incoming message has type STREAM_INVOCATION or CANCEL_INVOCATION. These are server->client message types that the Java SignalR client does not implement (the client initiates streams via stream(), it does not receive stream-invocation requests from the server). The protocol parses the type and explicitly rejects it.","triggerScenarios":"The server sends a STREAM_INVOCATION message (asking the client to start streaming results to the server) or a CANCEL_INVOCATION message. The client parses it in parseMessages and, in ReceiveLoop's switch (line 523-527), throws because handling is not implemented. Also thrown inside GsonHubProtocol.parseMessages at line 204 for the same types during parsing.","commonSituations":"A server-side hub invokes a client-side streaming method (server-to-client stream invocation), which the Java client cannot fulfill. A protocol or version mismatch where the server sends a message type the client doesn't expect. Misuse of the protocol where the server treats the client as a stream source.","solutions":["Avoid server-side designs that invoke client streaming methods on the Java client; the Java client only supports client->server streaming via stream().","Update to a newer client version that may support these message types, if available.","If the server is yours, change it so it does not send STREAM_INVOCATION/CANCEL_INVOCATION to Java clients."],"exampleFix":"// before: server-side hub calls a streaming method on the Java client\n// (server) await Clients.Caller.SendAsync(\"StreamToMe\", ...); // triggers STREAM_INVOCATION on client\n\n// after: server sends discrete invocations the Java client can handle with .on(...)\n// (server) await Clients.Caller.SendAsync(\"Item\", payload);\n// (client) connection.on(\"Item\", (Item p) -> { ... }, Item.class);","handlingStrategy":"type-guard","validationCode":"// There is no runtime pre-check; the fix is architectural: do not let the server\n// invoke client streaming methods on the Java client. Validate your server-side hub\n// design doesn't call stream-invocation toward Java clients.","typeGuard":"// The Java client only supports client->server streaming via stream().\n// Server->client streaming (STREAM_INVOCATION) is unsupported and cannot be guarded at runtime.\nboolean clientSupportsServerStreamInvocation = false;","tryCatchPattern":"// ReceiveLoop throws UnsupportedOperationException which propagates as a connection error.\n// Subscribe to start()/onClosed to detect it, but the real fix is server-side.\nconnection.onClosed(ex -> {\n    if (ex != null && ex.getMessage().contains(\"not supported yet\")) {\n        logger.error(\"Server sent an unsupported message type; redesign server-side streaming\");\n    }\n});","preventionTips":["Do not design the server to invoke client-side streaming methods on Java clients.","Use discrete invocations (connection.on(...)) for server->client notifications instead of streams.","Track client capabilities server-side and only send supported message types to Java clients."],"tags":["signalr","java","protocol","message-type","streaming","unsupported"],"analyzedSha":"294cab2f9b2e03af6b953820c7ab497c3c8b7ad9","analyzedAt":"2026-08-06T20:08:02.189Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}