Skip to content

Commit

Permalink
Fix muxer prefix
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
  • Loading branch information
Jarema committed Sep 30, 2023
1 parent 73e0aa2 commit 6b55e4f
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit 6b55e4f

Please sign in to comment.