Ejemplo n.º 1
0
qd_error_t qd_dispatch_configure_router(qd_dispatch_t *qd, qd_entity_t *entity)
{
    qd_dispatch_set_router_id(qd, qd_entity_opt_string(entity, "routerId", 0));
    QD_ERROR_RET();
    if (! qd->router_id) {
        qd_dispatch_set_router_id(qd, qd_entity_opt_string(entity, "id", 0));
        QD_ERROR_RET();
    }
    assert(qd->router_id);
    qd->router_mode = qd_entity_get_long(entity, "mode");
    QD_ERROR_RET();
    qd->thread_count = qd_entity_opt_long(entity, "workerThreads", 4);
    QD_ERROR_RET();

    if (! qd->sasl_config_path) {
        qd->sasl_config_path = qd_entity_opt_string(entity, "saslConfigPath", 0);
        QD_ERROR_RET();
    }
    if (! qd->sasl_config_name) {
        qd->sasl_config_name = qd_entity_opt_string(entity, "saslConfigName", "qdrouterd");
        QD_ERROR_RET();
    }

    char *dump_file = qd_entity_opt_string(entity, "debugDump", 0);
    QD_ERROR_RET();
    if (dump_file) {
        qd_alloc_debug_dump(dump_file);
        QD_ERROR_RET();
        free(dump_file);
    }

    return QD_ERROR_NONE;

}
Ejemplo n.º 2
0
/**
 * The Container Entity has been deprecated and will be removed in the future. Use the RouterEntity instead.
 */
qd_error_t qd_dispatch_configure_container(qd_dispatch_t *qd, qd_entity_t *entity)
{
    // Add a log warning. Check to see if too early
    qd->thread_count   = qd_entity_opt_long(entity, "workerThreads", 4); QD_ERROR_RET();
    qd->sasl_config_path = qd_entity_opt_string(entity, "saslConfigPath", 0); QD_ERROR_RET();
    qd->sasl_config_name = qd_entity_opt_string(entity, "saslConfigName", 0); QD_ERROR_RET();
    char *dump_file = qd_entity_opt_string(entity, "debugDump", 0); QD_ERROR_RET();
    if (dump_file) {
        qd_alloc_debug_dump(dump_file); QD_ERROR_RET();
        free(dump_file);
    }

    return QD_ERROR_NONE;
}