Skip to content

Commit

Permalink
Merge 2278811 into 9d5c791
Browse files Browse the repository at this point in the history
  • Loading branch information
tcrayford committed Feb 14, 2017
2 parents 9d5c791 + 2278811 commit 066652f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion commands/consumer_groups_create.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function * createConsumerGroup (context, heroku) {
if (context.args.CLUSTER) {
msg += ` on ${context.args.CLUSTER}`
}
var created = true

yield cli.action(msg, co(function * () {
return yield request(heroku, {
Expand All @@ -23,10 +24,19 @@ function * createConsumerGroup (context, heroku) {
}
},
path: `/data/kafka/${VERSION}/clusters/${addon.id}/consumer_groups`
}).catch(err => {
if (err.statusCode === 400 && err.body.message === 'this command is not required or enabled on dedicated clusters') {
created = false
cli.warn(`${cli.color.addon(addon.name)} does not need consumer groups managed explicitly, so this command does nothing`)
} else {
throw err
}
})
}))

cli.log(`Use \`heroku kafka:consumer-groups:info ${context.args.CONSUMER_GROUP}\` to monitor your consumer group.`)
if (created === true) {
cli.log(`Use \`heroku kafka:consumer-groups:info ${context.args.CONSUMER_GROUP}\` to monitor your consumer group.`)
}
})
}

Expand Down

0 comments on commit 066652f

Please sign in to comment.