Example #1
0
c_bool
v_groupStreamSubscribeGroup(
    v_groupStream stream,
    v_group group)
{
    c_bool inserted;

    assert(C_TYPECHECK(stream, v_groupStream));
    assert(C_TYPECHECK(group, v_group));

    if (v_reader(stream)->qos->durability.kind == v_topicQosRef(group->topic)->durability.kind) {
        struct groupMatched data;
        /*
         * OSPL-1073: Check if the new group matches with the group-expression list. This
         * is a collection of partition.topic strings that allows users to connect to specific
         * topics rather than connecting to all topics within a partition.
         */
        if(stream->expr) {
            data.matched = FALSE;
            data.group = group;
            c_walk(stream->expr, (c_action)isGroupMatched, &data);
        }else {
            data.matched = TRUE;
        }

        if(data.matched) {
            inserted = v_groupAddStream(group, stream);
            if(inserted == TRUE){
                c_insert(stream->groups, group);
            }
        }
    }
    return TRUE;
}
Example #2
0
c_bool
v_groupStreamSubscribeGroup(
    v_groupStream stream,
    v_group group)
{
    c_bool inserted;

    assert(C_TYPECHECK(stream, v_groupStream));
    assert(C_TYPECHECK(group, v_group));

    if (v_reader(stream)->qos->durability.kind == v_topicQosRef(group->topic)->durability.kind) {
        inserted = v_groupAddStream(group, stream);

        if(inserted == TRUE){
            c_insert(stream->groups, group);
        }
    }
    return TRUE;
}
Example #3
0
void
d_reportLocalGroup(
    d_durability d,
    const char *threadName,
    v_group group)
{
    const c_char* durability;
    v_topicQos qos;

    if(group){
        qos = v_topicQosRef(group->topic);
        switch(qos->durability.kind){
            case V_DURABILITY_VOLATILE:
                durability = "VOLATILE";
                break;
            case V_DURABILITY_TRANSIENT_LOCAL:
                durability = "TRANSIENT LOCAL";
                break;
            case V_DURABILITY_TRANSIENT:
                durability = "TRANSIENT";
                break;
            case V_DURABILITY_PERSISTENT:
                durability = "PERSISTENT";
                break;
            default:
                durability = "<<UNKNOWN>>";
                assert(FALSE);
                break;
        }
    } else {
        durability = "<<UNKNOWN>>";
        assert(FALSE);
    }
    d_printTimedEvent(d, D_LEVEL_FINE,
                      threadName, "Group found: %s.%s (%s)\n",
                      v_partitionName(v_groupPartition(group)),
                      v_topicName(v_groupTopic(group)),
                      durability);
}