#include "apr_general.h"
#include "stomp.h"
void main() {
apr_initialize();
apr_pool_t *pool;
apr_pool_create(&pool, NULL);
stomp_connection *connection;
stomp_connect(&connection, "localhost", 61613, pool);
stomp_frame connect_frame;
connect_frame.command = "CONNECT";
connect_frame.headers = NULL;
stomp_write(connection, &connect_frame, pool);
stomp_frame send_frame;
send_frame.command = "SEND";
send_frame.headers = apr_hash_make(pool);
apr_hash_set(send_frame.headers, "destination", APR_HASH_KEY_STRING, "SampleQueue");
send_frame.body_length = -1;
send_frame.body = "Simples Assim";
stomp_write(connection, &send_frame, pool);
stomp_frame disconnect_frame;
disconnect_frame.command = "DISCONNECT";
disconnect_frame.headers = NULL;
stomp_write(connection, &disconnect_frame, pool);
stomp_disconnect(&connection);
apr_pool_destroy(pool);
apr_terminate();
}
Advertisements