2626
2727#define SUMMARY_EVERY_US 5000
2828
29- static void send_batch (amqp_connection_state_t conn , char const * queue_name ,
29+ static void send_batch (amqp_connection_state_t conn , amqp_bytes_t queue_name ,
3030 int rate_limit , int message_count ) {
3131 uint64_t start_time = now_microseconds ();
3232 int i ;
@@ -49,8 +49,7 @@ static void send_batch(amqp_connection_state_t conn, char const *queue_name,
4949 uint64_t now = now_microseconds ();
5050
5151 die_on_error (amqp_basic_publish (conn , 1 , amqp_literal_bytes ("amq.direct" ),
52- amqp_cstring_bytes (queue_name ), 0 , 0 , NULL ,
53- message_bytes ),
52+ queue_name , 0 , 0 , NULL , message_bytes ),
5453 "Publishing" );
5554 sent ++ ;
5655 if (now > next_summary_time ) {
@@ -177,7 +176,7 @@ int main(int argc, char const *const *argv) {
177176 amqp_confirm_select (conn , 1 );
178177 die_on_amqp_error (amqp_get_rpc_reply (conn ), "Enable confirm-select" );
179178
180- send_batch (conn , "test queue" , rate_limit , message_count );
179+ send_batch (conn , amqp_literal_bytes ( "test queue" ) , rate_limit , message_count );
181180
182181 wait_for_acks (conn );
183182 die_on_amqp_error (amqp_channel_close (conn , 1 , AMQP_REPLY_SUCCESS ),
0 commit comments