Skip to content

Failed to create stream #20

@kchrome

Description

@kchrome

Following the tutorial I try to run my own service and get an error. What could I have done wrong?

{ok, Connection} = grpc_client:connect(tcp, "localhost", 10000).
{ok, Stream} = grpc_client:new_stream(Connection, 'Send', 'SendMessage', speak).

** exception error: no match of right hand side value {error,<<"failed to create stream">>}

speak.proto

syntax = "proto3";

  option java_multiple_files = true;

package Send;

service Send {

rpc SendMessage(Message) returns (readReciept) {}

}

message Message {

string messageContent = 1;

}

message readReciept {

string reciept = 1;

}

speak_client.erl

-module(speak_client).

%% this file was generated by grpc

-export(['SendMessage'/3]).

-type 'Message'() ::
    #{messageContent => string()}.

-type readReciept() ::
    #{reciept => string()}.

-export_type(['Message'/0,
              readReciept/0]).

-spec decoder() -> module().
%% The module (generated by gpb) used to encode and decode protobuf
%% messages.
decoder() -> speak.

%% RPCs for service 'Send'

-spec 'SendMessage'(
        Connection::grpc_client:connection(),
        Message::'Message'(),
        Options::[grpc_client:stream_option() |
                  {timeout, timeout()}]) ->
        grpc_client:unary_response(readReciept()).
%% This is a unary RPC
'SendMessage'(Connection, Message, Options) ->
    grpc_client:unary(Connection, Message,
                      'Send', 'SendMessage',
                       decoder(), Options).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions