This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service "RouteGuide" on new grpc:Listener(8980) { | |
remote function GetFeature(Point point) returns Feature|error { | |
foreach Feature feature in FEATURES { | |
if feature.location == point { | |
return feature; | |
} | |
} | |
return {location: point, name: ""}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service RouteGuide { | |
rpc GetFeature(Point) returns (Feature) {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerina/io; | |
import ballerina/jballerina.java; | |
public function main() { | |
LogRecord logRecord = { | |
time: "2021-05-04T10:32:13.220+05:30", | |
level: "DEBUG", | |
module: "foo/bar", | |
message: "debug \n message", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is the server implementation for the client streaming scenario. | |
import ballerina/grpc; | |
import ballerina/log; | |
@grpc:ServiceConfig { | |
name: "HelloWorld", | |
clientStreaming: true | |
} | |
service HelloWorld on new grpc:Listener(9090) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated by the protocol buffer compiler. DO NOT EDIT! | |
// source: ExampleServices.proto | |
package com.example.grpc; | |
/** | |
* Protobuf type {@code com.example.grpc.HelloRequest} | |
*/ | |
public final class HelloRequest extends | |
com.google.protobuf.GeneratedMessageV3 implements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerina.log; | |
import ballerina.io; | |
import ballerina.net.http; | |
// This service is a participant in the distributed transaction. It will get infected when it receives a transaction | |
// context from the participant. The transaction context, in the HTTP case, will be passed in as custom HTTP headers. | |
@http:configuration { | |
basePath:"/", | |
host:"localhost", | |
port:8890 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerina.log; | |
import ballerina.io; | |
import ballerina.net.http; | |
// This service is a participant in the distributed transaction. It will get infected when it receives a transaction | |
// context from the participant. The transaction context, in the HTTP case, will be passed in as custom HTTP headers. | |
@http:configuration { | |
basePath:"/flight", | |
host:"localhost", | |
port:8889 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerina.math; | |
import ballerina.net.http; | |
import ballerina.log; | |
import ballerina.io; | |
// This is the initiator of the distributed transaction | |
@http:configuration { | |
basePath:"/", | |
host:"localhost", | |
port:8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.ballerinalang.orbit.com.google.guava</groupId> | |
<artifactId>guava</artifactId> | |
<version>19.0.v1</version> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
package org.ballerinalang.net.grpc.helloworld; | |
import "google/protobuf/wrappers.proto"; | |
service helloWorld { | |
rpc hello(google.protobuf.StringValue) returns (google.protobuf.StringValue); | |
} |