Skip to content

Commit

Permalink
use mock kafka producer in frontend before cross DC is ready (#594)
Browse files Browse the repository at this point in the history
bugfix: missing cql change file in schema version update
  • Loading branch information
wxing1292 authored Mar 6, 2018
1 parent 3f14209 commit 5782955
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions schema/cadence/versioned/v0.5/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"MinCompatibleVersion": "0.5",
"Description": "add cross DC domain replication config, add target child workflow only to transfer task, add cross DC domain config verion, as a sequency ID to prevent out of order domain update, add flag indicating whether a domain is a global domain",
"SchemaUpdateCqlFiles": [
"add_domain_config_version.cql",
"add_replication_config.cql",
"add_target_child_workflow_only_to_transfer_task.cql"
]
Expand Down
14 changes: 11 additions & 3 deletions service/frontend/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ package frontend

import (
"github.com/uber/cadence/common"
"github.com/uber/cadence/common/messaging"
"github.com/uber/cadence/common/mocks"
"github.com/uber/cadence/common/persistence"
"github.com/uber/cadence/common/service"
)
Expand Down Expand Up @@ -114,9 +116,15 @@ func (s *Service) Start() {

history = persistence.NewHistoryPersistenceClient(history, base.GetMetricsClient())

kafkaProducer, err := base.GetMessagingClient().NewProducer(base.GetClusterMetadata().GetCurrentClusterName())
if err != nil {
log.Fatalf("Creating kafka producer failed: %v", err)
// TODO when global domain is enabled, uncomment the line below and remove the line after
var kafkaProducer messaging.Producer
if base.GetClusterMetadata().IsGlobalDomainEnabled() {
kafkaProducer, err = base.GetMessagingClient().NewProducer(base.GetClusterMetadata().GetCurrentClusterName())
if err != nil {
log.Fatalf("Creating kafka producer failed: %v", err)
}
} else {
kafkaProducer = &mocks.KafkaProducer{}
}

handler := NewWorkflowHandler(base, s.config, metadata, history, visibility, kafkaProducer)
Expand Down

0 comments on commit 5782955

Please sign in to comment.