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

Fix muxer prefix #1124

Merged
merged 1 commit into from
Sep 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions async-nats/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,8 @@ impl ConnectionHandler {
let multiplexer = if let Some(multiplexer) = self.multiplexer.as_mut() {
multiplexer
} else {
let subject = format!("{}.*", prefix);
let prefix = format!("{}.{}.", prefix, nuid::next());
let subject = format!("{}*", prefix);

self.connection.enqueue_write_op(&ClientOp::Subscribe {
sid: MULTIPLEXER_SID,
Expand All @@ -689,7 +690,7 @@ impl ConnectionHandler {

self.multiplexer.insert(Multiplexer {
subject,
prefix: format!("{}.", prefix),
prefix,
senders: HashMap::new(),
})
};
Expand All @@ -699,7 +700,7 @@ impl ConnectionHandler {
let pub_op = ClientOp::Publish {
subject,
payload,
respond: Some(respond),
respond: Some(format!("{}{}", multiplexer.prefix, token)),
headers,
};

Expand Down