小编Que*_*eff的帖子

了解kafka生产者的max.inflight属性

我在1.0.0-cp1版本的Kafka集群的工作台上工作.

在我的工作室的一部分,他们专注于订购保证和没有数据丢失的最大吞吐量(只有一个分区的主题),需要我将max.in.flight.requests.per.connection属性设置为1

我已经读过这篇文章

了解我只需要将max.in.flight设置为1,如果我使用该retries属性启用我的制作人的重试功能.

要问我的问题的另一种方法:只有一个分区+重试= 0(生产者道具),足以保证在卡夫卡的顺序?

我需要知道,因为增加max.in.flight会大大增加吞吐量.

configuration producer apache-kafka kafka-producer-api

8
推荐指数
3
解决办法
6263
查看次数

Join elem with next one in a functional style

I'm trying to find a way to "join"/"groupby" 2 elements in a list as following :

List("a","b","c","d")  -> List("ab","bc","cd")
Run Code Online (Sandbox Code Playgroud)

With a functional style.

Would someone know how to do this?

Need I use reducer, fold, scan, other higher-order function?

functional-programming scala list higher-order-functions

2
推荐指数
3
解决办法
79
查看次数

在catch块方法中递归调用返回值

这是我的问题:

我必须连接到代理服务(这里是activemq),所以我这样做:

public GenericMessageManager(String url, String producerQueue,
        String consumerQueue) {

    Connection connection;
    try {
        connection = getConnection(url);
        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        producer = createProducer(producerQueue);
        consumer = createConsumer(consumerQueue);
        connection.start();
        logger.info("Connection to broker started");
    } catch (JMSException e) {

    }
}

private Connection getConnection(String url) {
    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(
            url);
    try {
        Connection connection = connectionFactory.createConnection();
        return connection;
    } catch (JMSException e) {
        if (e.getLinkedException() instanceof SocketTimeoutException) {
            logger.warn(url + " not responding, try on localhost");
            getConnection("tcp://127.0.0.1:61616");
        }
    }
    return …
Run Code Online (Sandbox Code Playgroud)

java methods recursion return

0
推荐指数
1
解决办法
680
查看次数

如何在 Google Spanner 中查看数据库或表的索引?

如何查看我的数据库是否有任何索引?

对于特定的表呢?

sql cloud google-cloud-spanner

0
推荐指数
1
解决办法
162
查看次数