mirror of
https://github.com/uber-common/node-kafka-rest-client.git
synced 2026-02-01 17:27:30 +00:00
Default data cluster before going to local agent (#45)
This commit is contained in:
parent
68cb6e0a64
commit
f5d6ed93ff
@ -37,6 +37,7 @@ var emptyFunction = function EmptyFunction() {
|
||||
var defaultLocalAgentHost = 'localhost';
|
||||
var defaultLocalAgentPort = 5390;
|
||||
var defaultClusterUrl = 'LOGGING TOPICS';
|
||||
var defaultDataClusterUrl = 'DATA TOPICS';
|
||||
var hpTopicFormat = ['hp-', 'hp_', 'hp.'];
|
||||
var totalWaitingTimeMs = 0;
|
||||
// try connectWaitTimeMs.length times to connect to rest proxy
|
||||
@ -237,6 +238,9 @@ KafkaRestClient.prototype.produceWithRetry = function produceWithRetry(produceMe
|
||||
if (self.enable) {
|
||||
if (produceMessage.topic in self.cachedTopicToUrlMapping) {
|
||||
self.tryMakeRequest(produceMessage, retry, callback);
|
||||
} else if (defaultDataClusterUrl in self.cachedTopicToUrlMapping && self.clientType !== 'AtLeastOnce') {
|
||||
self.cachedTopicToUrlMapping[produceMessage.topic] = self.cachedTopicToUrlMapping[defaultDataClusterUrl];
|
||||
self.produceWithRetry(produceMessage, 0, callback);
|
||||
} else if (self.goToLocalAgent(produceMessage.topic)) {
|
||||
self.tryMakeRequest(produceMessage, self.maxRetries - 1, callback);
|
||||
} else if (defaultClusterUrl in self.cachedTopicToUrlMapping && self.clientType !== 'AtLeastOnce') {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user