How to use the auto.commit.interval.ms function in auto

To help you get started, weโ€™ve selected a few auto examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github joway / node-kfk / src / consumer.ts View on Github external
constructor(conf: any, topicConf: any = {}, options: Options = {}) {
    this.dying = false
    this.dead = false
    this.topics = []
    conf['auto.commit.interval.ms'] =
      conf['auto.commit.interval.ms'] || DEFAULT_AUTO_COMMIT_INTERVAL

    if (!conf['rebalance_cb']) {
      conf['rebalance_cb'] = (err: any, assignment: any) => {
        if (err.code === ErrorCode.ERR__ASSIGN_PARTITIONS) {
          this.consumer.assign(assignment)
          let rebalanceLog = 'consumer rebalance : '
          for (const assign of assignment) {
            rebalanceLog += `{topic ${assign.topic}, partition: ${assign.partition}} `
          }
          this.logger.info(rebalanceLog)
        } else if (err.code === ErrorCode.ERR__REVOKE_PARTITIONS) {
          this.consumer.unassign()
        } else {
          this.logger.error(err)
        }
github joway / node-kfk / src / consumer.ts View on Github external
constructor(conf: any, topicConf: any = {}, options: Options = {}) {
    this.dying = false
    this.dead = false
    this.topics = []
    conf['auto.commit.interval.ms'] =
      conf['auto.commit.interval.ms'] || DEFAULT_AUTO_COMMIT_INTERVAL

    if (!conf['rebalance_cb']) {
      conf['rebalance_cb'] = (err: any, assignment: any) => {
        if (err.code === ErrorCode.ERR__ASSIGN_PARTITIONS) {
          this.consumer.assign(assignment)
          let rebalanceLog = 'consumer rebalance : '
          for (const assign of assignment) {
            rebalanceLog += `{topic ${assign.topic}, partition: ${assign.partition}} `
          }
          this.logger.info(rebalanceLog)
        } else if (err.code === ErrorCode.ERR__REVOKE_PARTITIONS) {
          this.consumer.unassign()
        } else {
          this.logger.error(err)
        }
      }

auto

CLI tools to help facilitate semantic versioning based on GitHub PR labels

MIT
Latest version published 1 month ago

Package Health Score

83 / 100
Full package analysis