GithubHelp home page GithubHelp logo

gregwhitaker / proteus-springboot-example Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 130 KB

Example of building simple Proteus microservices in Spring Boot

Home Page: https://www.netifi.com

License: Apache License 2.0

Shell 14.52% Java 85.48%
netifi netifi-proteus springboot spring-boot reactive reactive-programming reactive-streams rsocket

proteus-springboot-example's Introduction

proteus-springboot-example

A simple example of integrating Spring Boot and Netifi Proteus to create request/reply interactions with microservices.

architectural diagram

Prerequisites

This example requires the following prerequisites:

  1. Protocol Buffers Compiler

    You can download the compiler from here: https://github.com/google/protobuf/releases

    OR

    If you are on a mac using homebrew you can install it with the following command:

     $ brew install protobuf
    
  2. A running instance of the Proteus Broker You can pull the latest Proteus Broker from DockerHub using the following command:

         $ docker pull netifi/proteus
    

    Start the Proteus Broker by running the following command:

         $ docker run -p 8001:8001 -p 7001:7001 -e BROKER_SERVER_OPTS='-Dnetifi.authentication.0.accessKey=3006839580103245170 -Dnetifi.authentication.0.accessToken=SkOlZxqQcTboZE3fni4OVXVC0e0=' netifi/proteus
    

Running the Example

Run the following Gradle commands in separate terminals to see the example:

  1. Start the helloworld-service

     $ ./gradlew :helloworld-service:run
    
  2. Start the helloworld-client

     $ ./gradlew :helloworld-client:run -PappArgs="['Foo']"
    

    You will see the following in the helloworld-client terminal when successful:

     Received from helloworld-service: Hello, Foo!
    

    You will see the following in the helloworld-service terminal when successful:

     Received Hello Request for: Foo
    

Note: The order in which you run the commands does not matter as Proteus clients/services are aware of their environment and will only start sending data when their dependent services are available.

  1. Now start another helloworld-service and send some more requests with helloworld-client. You will notice that requests are not being automatically load balanced across the instances of helloworld-service without any code or configuration change.

Bugs and Feedback

For bugs, questions, and discussions please use the Github Issues.

License

Copyright 2018 Netifi Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

proteus-springboot-example's People

Contributors

gregwhitaker avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.