Skip to content

Commit b764a29

Browse files
committed
it is not necessary to check if the queue exists
1 parent 673daad commit b764a29

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

src/main.cpp

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -138,23 +138,8 @@ class AMQT {
138138
q_arg_table
139139
);
140140
} else {
141-
auto r_check = amqp_queue_declare(
142-
m_connection, 1,
143-
amqp_cstring_bytes(queueName.c_str()),
144-
1, 0, 0, 0,
145-
amqp_empty_table
146-
);
147-
{
148-
auto reply = amqp_get_rpc_reply(m_connection);
149-
if (reply.reply_type == AMQP_RESPONSE_NORMAL) {
150-
amqp_queue_delete(m_connection, 1, amqp_cstring_bytes(queueName.c_str()), 0, 0);
151-
auto replyDelete = amqp_get_rpc_reply(m_connection);
152-
if (replyDelete.reply_type != AMQP_RESPONSE_NORMAL) {
153-
log::error("Error deleting queue: {}", AMQErrorToString(replyDelete));
154-
return;
155-
}
156-
}
157-
}
141+
amqp_queue_delete(m_connection, 1, amqp_cstring_bytes(queueName.c_str()), 0, 0);
142+
amqp_get_rpc_reply(m_connection);
158143
r = amqp_queue_declare(
159144
m_connection, 1,
160145
amqp_cstring_bytes(queueName.c_str()),

0 commit comments

Comments
 (0)