| Crates.io | baichun-framework-rms |
| lib.rs | baichun-framework-rms |
| version | 0.1.0 |
| created_at | 2025-06-16 11:26:40.722572+00 |
| updated_at | 2025-06-16 11:26:40.722572+00 |
| description | A high-performance, extensible message system module for Baichun-Framework, supporting multiple message brokers |
| homepage | |
| repository | https://github.com/fangbc5/Baichun-Framework |
| max_upload_size | |
| id | 1714167 |
| size | 135,715 |
RMS 是 Baichun-Framework 框架的消息传递系统模块,提供了统一的消息传递接口和多种消息中间件的集成支持。
在 Cargo.toml 中添加依赖:
[dependencies]
baichun-framework-rms = { version = "0.1.0" }
use baichun_framework_rms::bind;
let channel = bind!(factory, config);
let producer = bind!(producer factory, config);
producer.send("topic", message).await?;
let consumer = bind!(consumer factory, config);
consumer.subscribe("topic", |msg| {
// 处理消息
Ok(())
}).await?;
let config = KafkaConfig {
brokers: vec!["localhost:9092"],
group_id: "my-group",
client_id: "my-client",
// ... 其他配置
};
消息可靠性
性能优化
监控和维护
常见问题及解决方案:
连接超时
消息堆积
欢迎提交 Pull Request 或提出 Issue!
MIT License