Skip to content

Add Rust Client Examples for AutoMQ #52

@johnluoyx

Description

@johnluoyx

Feature Request: Rust Client Examples

Description

We would like to request the addition of Rust client examples to the client-examples directory, similar to the existing Java, C++, Go, and Python examples.

Motivation

Rust is gaining significant popularity in the systems programming community, especially for high-performance applications. Having Rust client examples would:

  • Help Rust developers quickly get started with AutoMQ
  • Demonstrate AutoMQ's performance capabilities in a systems programming language
  • Complete the language coverage for major programming languages
  • Provide examples for the growing Rust ecosystem in data streaming applications

Proposed Structure

Following the pattern of existing client examples, the Rust implementation should include:

client-examples/rust/
├── Cargo.toml
├── Dockerfile
├── README.md
├── docker-compose.yml
├── run-examples.sh
├── logs/
└── src/
    ├── main.rs
    ├── config/
    │   └── automq_config.rs
    └── examples/
        ├── simple_message_example.rs
        └── transactional_message_example.rs

Expected Features

  1. Simple Message Example: Basic producer and consumer functionality
  2. Transactional Message Example: Demonstrate transactional messaging capabilities
  3. AutoMQ Performance Tuning: Include AutoMQ-specific optimizations
  4. Docker Support: Docker Compose setup for easy testing
  5. Configuration Management: Environment variable support for flexible configuration
  6. Performance Metrics: Throughput and latency measurements
  7. Comprehensive Documentation: Clear setup and usage instructions

Technical Requirements

  • Use rdkafka crate (Rust Kafka client)
  • Follow Rust best practices and idioms
  • Include proper error handling
  • Support async/await patterns
  • Provide both blocking and non-blocking examples
  • Include unit tests

Dependencies

  • rdkafka - Kafka client library
  • tokio - Async runtime
  • serde - Serialization framework
  • clap - Command line argument parsing
  • env_logger - Logging

Reference

Please refer to existing client examples for consistency:

Additional Notes

  • Ensure compatibility with both AutoMQ Open Source and AutoMQ Cloud Service
  • Include examples for both single-node and cluster configurations
  • Provide clear migration guides from other Kafka Rust clients

This addition would greatly benefit the Rust community and showcase AutoMQ's versatility across different programming ecosystems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions