Skip to content

Commit

Permalink
Sample: same sId assert
Browse files Browse the repository at this point in the history
Signed-off-by: Evgeny Malygin <[email protected]>
  • Loading branch information
678098 committed Oct 20, 2023
1 parent 63fd3c9 commit 5177bcb
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/tutorials/subscriptions/consumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ static void consume(bmqa::Session* session,
// so it doesn't really matter. We believe it is far better for the
// application to provide its own ids than for BlazingMQ to supply a queue
// ids.
const char k_QUEUE_URL[] = "bmq://bmq.test.mem.priority/test-queue";
const char k_QUEUE_URL[] = "bmq://bmq.test.mem.fanout/test-queue";

bsl::string error;
bmqt::QueueOptions queueOptions;
Expand Down Expand Up @@ -712,14 +712,29 @@ static void consume(bmqa::Session* session,
}
}

{
// open "foo" appId
bmqt::CorrelationId corrId(bmqt::CorrelationId::autoValue());
bmqa::QueueId queueId(corrId);

bmqa::OpenQueueStatus status = session->openQueueSync(
&queueId,
k_QUEUE_URL + bsl::string("?id=foo"),
bmqt::QueueFlags::e_READ,
queueOptions);
}


// open "bar" appId
bmqt::CorrelationId corrId(bmqt::CorrelationId::autoValue());
bmqa::QueueId queueId(corrId);

bmqa::OpenQueueStatus status = session->openQueueSync(
&queueId,
k_QUEUE_URL,
k_QUEUE_URL + bsl::string("?id=bar"),
bmqt::QueueFlags::e_READ,
queueOptions);


if (!status || !queueId.isValid()) {
// Error! Log something
Expand Down

0 comments on commit 5177bcb

Please sign in to comment.