{"record":{"id":"00fa0ba2b7ca21e2","repo":"dotnet/aspnetcore","slug":"the-message-type-s-is-not-supported-yet","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/GsonHubProtocol.java","lineNumber":204,"sourceCode":"                        break;\n                    case STREAM_ITEM:\n                        if (resultToken != null) {\n                            Type returnType = binder.getReturnType(invocationId);\n                            try {\n                                result = gson.fromJson(resultToken, returnType != null ? returnType : Object.class);\n                            } catch (Exception ex) {\n                                argumentBindingException = ex;\n                            }\n                        }\n                        if (argumentBindingException != null) {\n                            hubMessages.add(new StreamBindingFailureMessage(invocationId, argumentBindingException));\n                        } else {\n                            hubMessages.add(new StreamItem(null, invocationId, result));\n                        }\n                        break;\n                    case STREAM_INVOCATION:\n                    case CANCEL_INVOCATION:\n                        throw new UnsupportedOperationException(String.format(\"The message type %s is not supported yet.\", messageType));\n                    case PING:\n                        hubMessages.add(PingMessage.getInstance());\n                        break;\n                    case CLOSE:\n                        if (error != null) {\n                            hubMessages.add(new CloseMessage(error));\n                        } else {\n                            hubMessages.add(new CloseMessage());\n                        }\n                        break;\n                    default:\n                        break;\n                }\n            }\n        } catch (IOException ex) {\n            throw new RuntimeException(\"Error reading JSON.\", ex);\n        }\n","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/3600ca084e9c8b5f4174fc5e747f4c52d2100806/src/SignalR/clients/java/signalr/core/src/main/java/com/microsoft/signalr/GsonHubProtocol.java#L186-L222","documentation":"Thrown by GsonHubProtocol.parseMessages when an incoming wire message has type STREAM_INVOCATION or CANCEL_INVOCATION. Those message types are defined for the protocol but are client->server directions: a client should never receive them. Receiving one indicates the server is trying to invoke a streaming method on the client or cancel one, which the Java client does not support.","triggerScenarios":"A server hub invokes a streaming method on the Java client (server-to-client streaming), or sends a CancelInvocation toward the client. The switch in parseMessages covers all HubMessageType values and throws UnsupportedOperationException for these two unsupported inbound cases.","commonSituations":"Server-side code calls Clients.Caller.SendAsync on a streaming method, or a hub uses IAsyncEnumerable/IAsyncStreaming toward the Java client; mixing the Java client with a server that assumes bidirectional streaming support that only the .NET/JS clients provide.","solutions":["Move server-to-client streaming off the Java client, or use the .NET/JS client which supports it.","If the server is yours, change the hub method to a regular invocation (SendAsync) or a client result only where supported.","Confirm the message type the server is emitting; if it is Channel/IAsyncEnumerable toward the client, that path is unsupported here."],"exampleFix":"// before: server pushes a stream to the Java client\n// C# hub: Clients.Caller.SendAsync(...) on an IAsyncEnumerable -> STREAM_INVOCATION on wire\n\n// after: server uses a non-streaming invocation\nawait Clients.Caller.SendAsync(\"ReceiveItem\", item);","handlingStrategy":"fallback","validationCode":"// Client-side: nothing to validate; the server chooses the message type.\n// Document/forbid server-to-client streaming toward the Java client at design time.\nboolean serverSupportsClientStreamingInbound = false; // set by platform matrix","typeGuard":"// No inbound type guard: the message type arrives on the wire.\n// Prevent by not exposing streaming hub methods to Java clients.","tryCatchPattern":"try {\n  conn.start().blockingAwait();\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"not supported yet\")) {\n    // switch to a non-streaming server method, or use the .NET/JS client\n  } else throw e;\n}","preventionTips":["Do not invoke streaming methods toward the Java client; use SendAsync.","Document which clients support server-to-client streaming in your hub.","Prefer the .NET or JS client when streaming to the client is required."],"tags":["signalr","java","protocol","streaming","unsupported"],"backgroundTag":null,"analyzedSha":"3600ca084e9c8b5f4174fc5e747f4c52d2100806","analyzedAt":"2026-08-11T16:32:30.678Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}