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

Expose 'nowait' exchange and queue parameter. #840

Open
WojciechSobczak opened this issue Jul 18, 2024 · 1 comment
Open

Expose 'nowait' exchange and queue parameter. #840

WojciechSobczak opened this issue Jul 18, 2024 · 1 comment

Comments

@WojciechSobczak
Copy link

I noticed that in exchange declare:

/**
 * amqp_exchange_declare
 *
 * @param [in] state connection state
 * @param [in] channel the channel to do the RPC on
 * @param [in] exchange exchange
 * @param [in] type type
 * @param [in] passive passive
 * @param [in] durable durable
 * @param [in] auto_delete auto_delete
 * @param [in] internal internal
 * @param [in] arguments arguments
 * @returns amqp_exchange_declare_ok_t
 */
AMQP_EXPORT
amqp_exchange_declare_ok_t *AMQP_CALL amqp_exchange_declare(
    amqp_connection_state_t state, amqp_channel_t channel,
    amqp_bytes_t exchange, amqp_bytes_t type, amqp_boolean_t passive,
    amqp_boolean_t durable, amqp_boolean_t auto_delete, amqp_boolean_t internal,
    amqp_table_t arguments) {
  amqp_exchange_declare_t req;
  req.ticket = 0;
  req.exchange = exchange;
  req.type = type;
  req.passive = passive;
  req.durable = durable;
  req.auto_delete = auto_delete;
  req.internal = internal;
  req.nowait = 0;
  req.arguments = arguments;

  return amqp_simple_rpc_decoded(state, channel, AMQP_EXCHANGE_DECLARE_METHOD,
                                 AMQP_EXCHANGE_DECLARE_OK_METHOD, &req);
}

and in queue declare:

/**
 * amqp_queue_declare
 *
 * @param [in] state connection state
 * @param [in] channel the channel to do the RPC on
 * @param [in] queue queue
 * @param [in] passive passive
 * @param [in] durable durable
 * @param [in] exclusive exclusive
 * @param [in] auto_delete auto_delete
 * @param [in] arguments arguments
 * @returns amqp_queue_declare_ok_t
 */
AMQP_EXPORT
amqp_queue_declare_ok_t *AMQP_CALL amqp_queue_declare(
    amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue,
    amqp_boolean_t passive, amqp_boolean_t durable, amqp_boolean_t exclusive,
    amqp_boolean_t auto_delete, amqp_table_t arguments) {
  amqp_queue_declare_t req;
  req.ticket = 0;
  req.queue = queue;
  req.passive = passive;
  req.durable = durable;
  req.exclusive = exclusive;
  req.auto_delete = auto_delete;
  req.nowait = 0;
  req.arguments = arguments;

  return amqp_simple_rpc_decoded(state, channel, AMQP_QUEUE_DECLARE_METHOD,
                                 AMQP_QUEUE_DECLARE_OK_METHOD, &req);
}

nowait parameter is not exposed by API for reason I don't know about.

Is it possible to expose it as function parameter? And if not, is there any way to set it?

Thanks in advance.

@manchicken
Copy link

I'm curious what would be gained, but I'm also curious how you'd want to see this working in the case that you tried to create a channel but the operation failed for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants