GithubHelp home page GithubHelp logo

opentoolset / netty-agents Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 165 KB

Easy to use, strong-typing, message based and synchronous communication library based on Netty (https://netty.io/).

License: Apache License 2.0

Java 100.00%
communication-library message-driven sync-async request-response strong-typing tls-mutual-authentication netty

netty-agents's Introduction

Netty Agents

Easy to use, message based communication library based on Netty (https://netty.io/).

Features

  • Support for bi-directional communication with continuous channels,
  • Performance, customization and flexibility using nice features of Netty library (socket level communication, pipes and filters pattern, etc.)
  • Ability to design and use of a strongly-typed (with POJO objects) and well-defined protocol in applications
  • Support for blocking, request-response based communication model as well as supporting asynchronous pattern
  • Easily implementation of communication and security requirements in any Java project by writing lower code using a simplified library interface based on agent concept.
  • Secure communication with TLS and mutual certificate authentication

Simple Use Case

Sample server code like below:

// ...

ServerAgent serverAgent = new ServerAgent();
serverAgent.setMessageHandler(SampleMessage.class, message -> handleMessage(message));
serverAgent.setRequestHandler(SampleRequest.class, request -> handleRequest(request));
serverAgent.startup();

private static void handleMessage(SampleMessage message) {
    // ...
    // business logic
    // ...
}

private static SampleResponse handleRequest(SampleRequest request) {
    SampleResponse response = new SampleResponse();
    // ...
    // business logic
    // ...
    return response;
}

Sample client code like below:

ClientAgent clientAgent = new ClientAgent();
serverAgent.startup();
clientAgent.sendMessage(new SampleMessage()); // Sends a message to server without waiting a response
SampleResponse response = clientAgent.doRequest(new SampleRequest()); // Sends a request to server by waiting until receiving a response or timeout

For detailed usage examples please read and try JUnit tests below:

  • MTNettyAgents
  • MTMultiClient

netty-agents's People

Contributors

dependabot[bot] avatar hadidilek avatar

Watchers

 avatar

Forkers

lloydkwon

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.