docs.rs failed to build rsolace-0.3.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
rsolace-0.3.9
rsolace
High-performance Rust bindings for the Solace messaging system with native async/await support.
โจ Features
- ๐ Full Async Support: Native async/await with kanal + tokio
- โก High Performance: Zero-copy message handling, efficient channels
- ๐ Flexible Patterns: Sync, async, or mixed messaging patterns
- ๐ฆ Complete API: Pub/Sub, Request/Reply, Message Caching, Events
- ๐ก๏ธ Type Safe: Comprehensive error handling with snafu
- ๐ง Easy Integration: Drop-in replacement for existing Solace apps
๐ Quick Start
Add to your Cargo.toml:
[]
= { = "0.2.0", = ["tokio", "channel"] }
= { = "1.28", = ["full"] }
Async Example
use ;
use SolMsg;
use SolClientLogLevel;
async
Sync Example
use ;
use SolClientLogLevel;
๐ Migration from crossbeam-channel
We've migrated from crossbeam-channel to kanal for native async support:
// Before (crossbeam-channel)
let receiver = client.get_msg_receiver;
receiver.recv.unwrap; // Sync only
// After (kanal) - Both sync and async!
let receiver = client.get_msg_receiver;
receiver.recv.unwrap; // Sync (unchanged)
let async_receiver = client.get_async_msg_receiver;
async_receiver.recv.await.unwrap; // Async (NEW!)
๐ ๏ธ Features
Enable features in your Cargo.toml:
[]
= { = "0.2.0", = ["tokio", "channel", "raw"] }
| Feature | Description |
|---|---|
channel |
Kanal-based sync/async channel support (default) |
tokio |
Async support with tokio runtime |
raw |
Direct callback-based message handling |
๐ API Overview
Client Management
let mut client = new?;
client.connect;
client.disconnect;
Messaging Patterns
// Pub/Sub
client.subscribe;
client.send_msg;
// Request/Reply (Sync)
let response = client.send_request?;
// Request/Reply (Async)
let response = client.send_request_async.await?;
Message Handling
// Sync receivers
let msg_receiver = client.get_msg_receiver;
let event_receiver = client.get_event_receiver;
let request_receiver = client.get_request_receiver;
let p2p_receiver = client.get_p2p_receiver;
// Async receivers (with tokio feature)
let async_msg_receiver = client.get_async_msg_receiver;
let async_event_receiver = client.get_async_event_receiver;
let async_request_receiver = client.get_async_request_receiver;
let async_p2p_receiver = client.get_async_p2p_receiver;
Message Creation
let mut msg = new?;
msg.set_topic;
msg.set_binary_attachment;
msg.set_delivery_mode;
msg.set_correlation_id;
๐ง Configuration
Session Properties
let props = default
.host
.vpn
.username
.password
.compression_level // 1-9
.connect_retries
.reconnect_retries
.keep_alive_int_ms
.reapply_subscriptions
.generate_sender_id
.generate_timestamps;
๐๏ธ Building
# Basic build
# With async support
# All features
# Run examples
๐ Examples
See the examples/ directory for comprehensive usage patterns:
pubsub.rs- Publisher/Subscriber patternrequester.rs- Request/Reply clientreplier.rs- Request/Reply servercache.rs- Message cachingasync_example.rs- Async patterns
๐งช Testing
# Run tests
# Test with async features
๐ Documentation
- Main Project: See root README for full documentation
- Python Bindings: Check pyrsolace
- API Docs: Run
cargo doc --open - Examples: Comprehensive examples in
examples/directory
๐ค Contributing
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass:
cargo test --features tokio - Submit a pull request
๐ License
GPL-3.0-only License - see LICENSE for details.
Need Python bindings? Check out pyrsolace for full async Python support! ๐