diff --git a/Cargo.toml b/Cargo.toml index 0aff023..a65c7fb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "device-common" -version = "0.1.11" +version = "0.1.12" edition = "2021" authors = ["Ryan Bae "] diff --git a/RELEASE_NOTE.md b/RELEASE_NOTE.md index 6e23952..183d8b0 100644 --- a/RELEASE_NOTE.md +++ b/RELEASE_NOTE.md @@ -1,3 +1,7 @@ +0.1.12 +====== +- kinesis 에 byte array 로 put 하는 함수 추가 + 0.1.11 ====== - metrics 통합 diff --git a/src/aws/kinesis.rs b/src/aws/kinesis.rs index b982306..4d0220e 100644 --- a/src/aws/kinesis.rs +++ b/src/aws/kinesis.rs @@ -33,6 +33,11 @@ async fn get_client() -> Arc { pub async fn kinesis_put_record(msg: &String) -> Result<(), DeviceError> { let blob = msg.as_bytes(); + + kinesis_put_bytes(blob) +} + +pub async fn kinesis_put_bytes(bytes: &[u8]) -> Result<(), DeviceError> { let config = crate::config::get_config() .await .clone(); @@ -40,7 +45,7 @@ pub async fn kinesis_put_record(msg: &String) -> Result<(), DeviceError> { get_client() .await .put_record() - .data(Blob::new(blob)) + .data(Blob::new(bytes)) .partition_key(&config.kinesis_stream.node.partition_key) .stream_name(&config.kinesis_stream.node.name) .stream_arn(&config.kinesis_stream.node.arn)