Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Rust implementation for msk-to-lambda integration #210

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sachinh
Copy link

@sachinh sachinh commented Aug 21, 2024

Issue #, if available:

Description of changes:
Rust Implementation for MSK to Lambda integration

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

#[tokio::main]
async fn main() -> Result<(), Error> {

tracing_subscriber::fmt().json()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use 'tracing::init_default_subscriber();' to replace this. This is a new function provided by Rust Runtime to simplify this part.


for record in records {

let record_text = record.value.as_ref().unwrap();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use unwrap() here, use '?' to propergate the error.


// perform Base64 decoding
let record_bytes = BASE64_STANDARD.decode(record_text).unwrap();
let message = std::str::from_utf8(&record_bytes).unwrap();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, don't use unwrap() here, use '?' to propergate the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants