[rabbitmq-discuss] Publish to exchange that doesn't bind to any queue in trunsaction mode

Haster haster2004 at yandex.ru
Mon Jul 1 10:52:13 BST 2013


Hi there!

I open channel in transaction mode and try to publish some message to
exchange, that doesn't bind to any queue.
And after commit I have no any error...

I expected that commit will return some error...

Do you know where my message is after that? Is it dropped and if so why I
doesn't receive any error?


Pseudo code:
 amqp_new_connection();
amqp_open_socket(host, port); 
amqp_set_sockfd(conn, sockfd);
amqp_login(conn, "/", 0, 131072, 0, AMQP_SASL_METHOD_PLAIN, user, pass);
amqp_channel_open(conn, channel_exchange);
amqp_rpc_reply_t res = amqp_get_rpc_reply(conn);
amqp_tx_select(conn, channel_exchange);
res = amqp_get_rpc_reply(conn);
... form message ...
  int r = amqp_basic_publish(conn, channel_exchange, exchange_bytes,
routingKey_bytes,  1, 0, &props, message_bytes);
  if (r < 0) {
    char *errstr = amqp_error_string(-r);
    cout << errstr;
    free(errstr);
    char ch;
    cin >> ch;
  }


  amqp_tx_commit(conn, channel_exchange);
  die_on_amqp_error(amqp_get_rpc_reply(conn), "Commit error");

  cout << "Publish = " << r << endl;
  char ch;
  cin >> ch;



--
View this message in context: http://rabbitmq.1065348.n5.nabble.com/Publish-to-exchange-that-doesn-t-bind-to-any-queue-in-trunsaction-mode-tp27706.html
Sent from the RabbitMQ mailing list archive at Nabble.com.


More information about the rabbitmq-discuss mailing list