Skip to content

Dingo Spring Boot Starter is a high-performance RPC framework designed for distributed systems, built on Netty with support for Mina and Grizzly transport layers. It seamlessly integrates with Spring Boot and Spring Cloud, enabling asynchronous and synchronous data communication.

Notifications You must be signed in to change notification settings

paganini2008/dingo-spring-boot-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Dingo Spring Boot Starter

License Spring Boot Spring Cloud Netty

Dingo Spring Boot Starter is a robust and feature-rich RPC (Remote Procedure Call) data transmission framework designed to streamline communication in distributed systems. Built on top of Netty, with optional support for Mina and Grizzly, Dingo offers unmatched flexibility and scalability. Seamlessly integrating with Spring Boot and Spring Cloud, this framework is tailored for high-performance, non-HTTP-based service-to-service communication while ensuring reliability and resilience under high-concurrency scenarios.


Features

1. Asynchronous Data Transmission

Dingo excels in handling high-concurrency environments with its support for asynchronous data sending and receiving. Key benefits include:

  • Scalable Event Handling: Ideal for scenarios such as network crawling, log aggregation, and real-time event streaming.
  • Non-Blocking Architecture: Powered by Netty's non-blocking IO, ensuring efficient resource utilization and high throughput.

2. Synchronous RPC Communication

For applications requiring strict request-response patterns, Dingo provides robust synchronous RPC communication:

  • Remote Method Invocation (RMI): Perform method calls on remote services without relying on traditional HTTP protocols.
  • Ordered Processing: Ensure consistent data flow in pipelines and workflows.

3. Advanced Transport Layer Flexibility

Dingo supports multiple transport layers to adapt to diverse application needs:

  • Netty: Default choice for high-performance and scalability.
  • Mina: Lightweight and developer-friendly.
  • Grizzly: Suitable for enterprise-grade applications, offering advanced HTTP/2 and WebSocket support.

The transport layer is configurable via application properties, providing effortless adaptability.


4. Resilience and Reliability Features

Dingo is designed to handle high-concurrency demands while maintaining service reliability. It includes:

  • Retry Mechanisms: Automatically retries failed requests to ensure data delivery under transient failures.
  • Rate Limiting: Controls the flow of requests to prevent overload during traffic spikes.
  • Fallbacks and Downgrades: Provides alternative responses when primary services are unavailable.
  • Circuit Breaking: Detects and isolates failing services to prevent cascading failures.

These features make Dingo an ideal framework for mission-critical systems requiring robust fault tolerance.


5. Seamless Integration with Spring Ecosystem

Dingo fully integrates with Spring Boot and Spring Cloud, enabling:

  • Auto-Configuration: Simplifies setup with minimal boilerplate.
  • Service Discovery and Load Balancing: Works with Spring Cloud registries like Eureka and Zookeeper.
  • Unified API: Consistent API for developers, abstracting transport and discovery complexities.

Getting Started

1. Add Dependency

Include the following dependency in your pom.xml:

<dependency>
    <groupId>com.github.paganini2008</groupId>
    <artifactId>dingo-spring-boot-starter</artifactId>
    <version>1.0.0-SNAPSHOT</version>
</dependency>

2. Configure Application Properties

Add the necessary configuration to application.yml:

dingo:
  transmitter:
    nio:
      selection: netty # Options: netty, mina, grizzly
  rpc:
    async: false
    retry:
      enabled: true
      maxAttempts: 3
      

3. Define Services

Annotate your service methods with @RpcClient to expose them as RPC endpoints:

@RpcClient(serviceId = "doodler-transmitter-service", beanName = "testService", timeout = 60,
        timeUnit = TimeUnit.SECONDS, retryInterval = 1,
        fallbackFactory = TestRpcFallbackFactory.class)
public interface TestServiceRpcClient {

    String helloWorld(String name);

}

Declare FallbackFactory (Optional)

public class TestRpcFallbackFactory implements RpcFallbackFactory<TestServiceProxy> {

    @Override
    public TestServiceProxy getFallback(Throwable e) {
        return new TestServiceProxy() {

            @Override
            public String helloWorld(String name) {
                return "Bad: I am fallback: " + name;
            }
        };
    }

}

4. Invoke Remote Services

Use the DingoClient to perform remote calls:

@Autowired
private TestServiceRpcClient testServiceRpcClient;

public void sendRequest() {
    String response = testServiceRpcClient.helloWorld("Java!");
    System.out.println(response);// Hello world: Java!
}

Documentation

For detailed documentation and advanced usage, refer to the Official Documentation.


Contributing

We welcome contributions! Please refer to the Contributing Guide for guidelines.


License

This project is licensed under the MIT License. See the LICENSE file for details.


Dingo Spring Boot Starter empowers developers to build high-performance, scalable, and fault-tolerant distributed systems. Whether handling asynchronous event streams or synchronous RPC calls, Dingo provides a comprehensive and customizable framework for modern microservice architectures.

About

Dingo Spring Boot Starter is a high-performance RPC framework designed for distributed systems, built on Netty with support for Mina and Grizzly transport layers. It seamlessly integrates with Spring Boot and Spring Cloud, enabling asynchronous and synchronous data communication.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages