src/rdkafka_broker.c
rd_kafka_broker_t *rd_kafka_broker_add_logical (rd_kafka_t *rk,
                                                const char *name) {
        rd_kafka_broker_t *rkb;

        rd_kafka_wrlock(rk);
        rkb = rd_kafka_broker_add(rk, RD_KAFKA_LOGICAL,
                                  rk->rk_conf.security_protocol,
                                  name, 0/*port*/, -1/*brokerid*/);
        rd_assert(rkb && *"failed to create broker thread");
        rd_kafka_wrunlock(rk);

        rd_atomic32_add(&rk->rk_broker_addrless_cnt, 1);

        rd_dassert(RD_KAFKA_BROKER_IS_LOGICAL(rkb));
        rd_kafka_broker_keep(rkb);
        return rkb;
}
/**
 * @brief Adds a logical broker.
 *
 *        Logical brokers act just like any broker handle, but will not have
 *        an initial address set. The address (or nodename is it is called
 *        internally) can be set from another broker handle
 *        by calling rd_kafka_broker_set_nodename().
 *
 *        This allows maintaining a logical group coordinator broker
 *        handle that can ambulate between real broker addresses.
 *
 *        Logical broker constraints:
 *         - will not have a broker-id set (-1).
 *         - will not have a port set (0).
 *         - the address for the broker may change.
 *         - the name of broker will not correspond to the address,
 *           but the \p name given here.
 *
 * @returns a new broker, holding a refcount for the caller.
 *
 * @locality any rdkafka thread
 * @locks none
 */
@brief Adds a logical broker.
Logical brokers act just like any broker handle, but will not have
an initial address set. The address (or nodename is it is called
internally) can be set from another broker handle
by calling rd_kafka_broker_set_nodename().

This allows maintaining a logical group coordinator broker
handle that can ambulate between real broker addresses.

Logical broker constraints:
- will not have a broker-id set (-1).
- will not have a port set (0).
- the address for the broker may change.
- the name of broker will not correspond to the address,
but the \p name given here.

@returns a new broker, holding a refcount for the caller.

@locality any rdkafka thread
@locks none
@brief Adds a logical broker . Logical brokers act just like any broker handle but will not have an initial address set . The address ( or nodename is it is called internally ) can be set from another broker handle by calling rd_kafka_broker_set_nodename () . This allows maintaining a logical group coordinator broker handle that can ambulate between real broker addresses . Logical broker constraints : - will not have a broker - id set ( - 1 ) . - will not have a port set ( 0 ) . - the address for the broker may change . - the name of broker will not correspond to the address but the \ p name given here . @returns a new broker holding a refcount for the caller . @locality any rdkafka thread @locks none
rd_kafka_broker_t *rd_kafka_broker_add_logical (rd_kafka_t *rk,
                                                const char *name) {
        rd_kafka_broker_t *rkb;
        rd_kafka_wrlock(rk);
        rkb = rd_kafka_broker_add(rk, RD_KAFKA_LOGICAL,
                                  rk->rk_conf.security_protocol,
                                  name, 0, -1);
        rd_assert(rkb && *"failed to create broker thread");
        rd_kafka_wrunlock(rk);
        rd_atomic32_add(&rk->rk_broker_addrless_cnt, 1);
        rd_dassert(RD_KAFKA_BROKER_IS_LOGICAL(rkb));
        rd_kafka_broker_keep(rkb);
        return rkb;
}
rd_kafka_broker_t * rd_kafka_broker_add_logical ( rd_kafka_t * rk , const char * name ) { rd_kafka_broker_t * rkb ; rd_kafka_wrlock ( rk ) ; rkb = rd_kafka_broker_add ( rk , RD_KAFKA_LOGICAL , rk -> rk_conf . security_protocol , name , 0 , -1 ) ; rd_assert ( rkb && * " " ) ; rd_kafka_wrunlock ( rk ) ; rd_atomic32_add ( & rk -> rk_broker_addrless_cnt , 1 ) ; rd_dassert ( RD_KAFKA_BROKER_IS_LOGICAL ( rkb ) ) ; rd_kafka_broker_keep ( rkb ) ; return rkb ; }
@brief Adds a logical broker.
@brief Adds a logical broker .
/*port*/ /*brokerid*/