import ballerina/io;
import ballerina/grpc;

function main (string... args) {
{{#nonBlockingEndpoint}}
     endpoint {{connectorId}}Client {{connectorIdName}}Ep {
        url:"http://localhost:9090"
     };{{/nonBlockingEndpoint}}{{#blockingEndpoint}}
    endpoint {{connectorId}}BlockingClient {{connectorIdName}}BlockingEp {
        url:"http://localhost:9090"
    };
{{/blockingEndpoint}}
}

{{#messageListener}}
service<grpc:Service> {{connectorId}}MessageListener {

    onMessage (string message) {
        io:println("Response received from server: " + message);
    }

    onError (error err) {
        if (err != ()) {
            io:println("Error reported from server: " + err.message);
        }
    }

    onComplete () {
        io:println("Server Complete Sending Responses.");
    }
}
{{/messageListener}}