static int stomp_connected_subscribe(sf_t *sf, void *udata, stomp_msg_t *msg) { char dest[256]; if (stomp_read_header(dest, sizeof(dest), msg, "destination:") < 0) { plog(LOG_ERR, "%s: destination header is not found", __func__); return -1; } return stomp_subscribe(sf, dest); }
static void _connected(stomp_session_t *s, void *ctx, void *session_ctx) { struct ctx *c = session_ctx; struct stomp_hdr hdrs[] = { {"destination", c->destination}, }; int err = stomp_subscribe(s, sizeof(hdrs)/sizeof(struct stomp_hdr), hdrs); if (err<0) { perror("stomp"); } }