Skip to content

Commit

Permalink
Add replication task history v2 to the kafka producer (cadence-workfl…
Browse files Browse the repository at this point in the history
…ow#3101)

* Add replication task history v2 to the Kafka producer
  • Loading branch information
yux0 authored Mar 9, 2020
1 parent 7e1eb3b commit 1d866ea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion common/messaging/kafkaProducer.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,16 @@ func (p *kafkaProducer) getKeyForReplicationTask(task *replicator.ReplicationTas
switch task.GetTaskType() {
case replicator.ReplicationTaskTypeHistory:
// Use workflowID as the partition key so all replication tasks for a workflow are dispatched to the same
// Kafka partition. This will give us some ordering guarantee for workflow replication tasks atleast at
// Kafka partition. This will give us some ordering guarantee for workflow replication tasks at least at
// the messaging layer perspective
attributes := task.HistoryTaskAttributes
return sarama.StringEncoder(attributes.GetWorkflowId())
case replicator.ReplicationTaskTypeHistoryV2:
// Use workflowID as the partition key so all replication tasks for a workflow are dispatched to the same
// Kafka partition. This will give us some ordering guarantee for workflow replication tasks at least at
// the messaging layer perspective
attributes := task.HistoryTaskV2Attributes
return sarama.StringEncoder(attributes.GetWorkflowId())
case replicator.ReplicationTaskTypeSyncActivity:
// Use workflowID as the partition key so all sync activity tasks for a workflow are dispatched to the same
// Kafka partition. This will give us some ordering guarantee for workflow replication tasks atleast at
Expand Down

0 comments on commit 1d866ea

Please sign in to comment.