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.
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.
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.
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.
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.
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.
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>
Add the necessary configuration to application.yml
:
dingo:
transmitter:
nio:
selection: netty # Options: netty, mina, grizzly
rpc:
async: false
retry:
enabled: true
maxAttempts: 3
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;
}
};
}
}
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!
}
For detailed documentation and advanced usage, refer to the Official Documentation.
We welcome contributions! Please refer to the Contributing Guide for guidelines.
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.