Skip to content

Commit

Permalink
Respond with content-type octet-stream (#34)
Browse files Browse the repository at this point in the history
* Respond with content-type octet-stream

* Update kanin/src/app/task.rs

Co-authored-by: Victor Nordam Suadicani <[email protected]>

* Update version to 0.28.1

---------

Co-authored-by: Victor Nordam Suadicani <[email protected]>
  • Loading branch information
AndreasDahl and Victor-N-Suadicani authored Jan 23, 2024
1 parent 46fdb7b commit 0bc3cf2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kanin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kanin"
version = "0.28.0"
version = "0.28.1"
edition = "2021"
authors = ["Victor Nordam Suadicani <[email protected]>"]
description = "An RPC microservice framework for AMQP, protobuf and Rust built on lapin (https://github.com/amqp-rs/lapin)."
Expand Down
5 changes: 4 additions & 1 deletion kanin/src/app/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use futures::{stream::FuturesUnordered, Future, StreamExt};
use lapin::{
acker::Acker,
options::{BasicAckOptions, BasicConsumeOptions, BasicPublishOptions, BasicQosOptions},
types::FieldTable,
types::{FieldTable, ShortString},
BasicProperties, Channel, Connection, Consumer,
};
use tracing::{debug, error, info, info_span, trace, warn, Instrument};
Expand Down Expand Up @@ -145,6 +145,9 @@ async fn handle_request<H, S, Args, Res>(
);
}

// Since we expect the response to be encoded Protobuf, we set the content type to octet-stream.
props = props.with_content_type(ShortString::from("application/octet-stream"));

let publish = channel
.basic_publish(
HandlerConfig::DEFAULT_EXCHANGE,
Expand Down

0 comments on commit 0bc3cf2

Please sign in to comment.