Skip to content

Commit

Permalink
feat/FPAY-1744: Add settlements topics to openbanking (#750)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafdekar authored Jan 13, 2025
1 parent a18dd79 commit 2068e6f
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 3 deletions.
44 changes: 42 additions & 2 deletions dev-aws/kafka-shared-msk/payment-platform/open-banking.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,46 @@ resource "kafka_topic" "openbanking_deadletter_v1_internal_payment_methods" {
}
}

resource "kafka_topic" "openbanking_v1_internal_settlements" {
name = "payment-platform.openbanking.v1.internal.settlements"
replication_factor = 3
partitions = 5
config = {
"compression.type" = "zstd"
"retention.bytes" = "-1" # keep on each partition unlimited data
# Use tiered storage
"remote.storage.enable" = "true"
# keep data in primary storage for 2 days
"local.retention.ms" = "172800000"
# keep data for 1 month
"retention.ms" = "2592000000"
"cleanup.policy" = "delete"
}
}

resource "kafka_topic" "openbanking_deadletter_v1_internal_settlements" {
name = "payment-platform.openbanking-deadletter.v1.internal.settlements"
replication_factor = 3
partitions = 5
config = {
"compression.type" = "zstd"
"retention.bytes" = "-1" # keep on each partition unlimited data
# Use tiered storage
"remote.storage.enable" = "true"
# keep data in primary storage for 2 days
"local.retention.ms" = "172800000"
# keep data for 1 month
"retention.ms" = "2592000000"
"cleanup.policy" = "delete"
}
}

module "openbanking_apid" {
source = "../../../modules/tls-app"
produce_topics = [
kafka_topic.openbanking_v1_internal_payments.name,
kafka_topic.openbanking_v1_internal_payment_methods.name,
kafka_topic.openbanking_v1_internal_settlements.name,
kafka_topic.payment_v1_events.name
]
cert_common_name = "payment-platform/openbanking-apid"
Expand All @@ -81,11 +116,13 @@ module "openbanking_consumerd" {
produce_topics = [
kafka_topic.openbanking_deadletter_v1_internal_payments.name,
kafka_topic.openbanking_deadletter_v1_internal_payment_methods.name,
kafka_topic.openbanking_deadletter_v1_internal_settlements.name,
kafka_topic.payment_v1_events.name
]
consume_topics = [
kafka_topic.openbanking_v1_internal_payments.name,
kafka_topic.openbanking_v1_internal_payment_methods.name
kafka_topic.openbanking_v1_internal_payment_methods.name,
kafka_topic.openbanking_v1_internal_settlements.name
]
consume_groups = ["payment-platform.openbanking_consumerd"]
cert_common_name = "payment-platform/openbanking-consumerd"
Expand All @@ -94,7 +131,8 @@ module "openbanking_consumerd" {
module "openbanking_crond" {
source = "../../../modules/tls-app"
produce_topics = [
kafka_topic.payment_v1_events.name
kafka_topic.payment_v1_events.name,
kafka_topic.openbanking_v1_internal_settlements.name
]
consume_groups = ["payment-platform.openbanking_crond"]
cert_common_name = "payment-platform/openbanking-crond"
Expand All @@ -107,12 +145,14 @@ module "payment_deadletterd" {
kafka_topic.payment_method_v1_events.name,
kafka_topic.openbanking_v1_internal_payments.name,
kafka_topic.openbanking_v1_internal_payment_methods.name,
kafka_topic.openbanking_v1_internal_settlements.name
]
consume_topics = [
kafka_topic.payment_deadletter_v1_events.name,
kafka_topic.payment_method_deadletter_v1_events.name,
kafka_topic.openbanking_deadletter_v1_internal_payments.name,
kafka_topic.openbanking_deadletter_v1_internal_payment_methods.name,
kafka_topic.openbanking_deadletter_v1_internal_settlements.name
]
consume_groups = ["payment-platform.payment-deadletterd"]
cert_common_name = "payment-platform/payment-deadletterd"
Expand Down
42 changes: 41 additions & 1 deletion prod-aws/kafka-shared-msk/payment-platform/open-banking.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,46 @@ resource "kafka_topic" "openbanking_deadletter_v1_internal_payment_methods" {
}
}

resource "kafka_topic" "openbanking_v1_internal_settlements" {
name = "payment-platform.openbanking.v1.internal.settlements"
replication_factor = 3
partitions = 15
config = {
"compression.type" = "zstd"
"retention.bytes" = "3758096384" # keep on each partition 3.5GiB
# Use tiered storage
"remote.storage.enable" = "true"
# keep data in primary storage for 2 days
"local.retention.ms" = "172800000"
# keep data for 1 year
"retention.ms" = "31557600000"
"cleanup.policy" = "delete"
}
}

resource "kafka_topic" "openbanking_deadletter_v1_internal_settlements" {
name = "payment-platform.openbanking-deadletter.v1.internal.settlements"
replication_factor = 3
partitions = 15
config = {
"compression.type" = "zstd"
"retention.bytes" = "3758096384" # keep on each partition 3.5GiB
# Use tiered storage
"remote.storage.enable" = "true"
# keep data in primary storage for 2 days
"local.retention.ms" = "172800000"
# keep data for 1 year
"retention.ms" = "31557600000"
"cleanup.policy" = "delete"
}
}

module "openbanking_apid" {
source = "../../../modules/tls-app"
produce_topics = [
kafka_topic.openbanking_v1_internal_payments.name,
kafka_topic.openbanking_v1_internal_payment_methods.name,
kafka_topic.openbanking_v1_internal_settlements.name,
kafka_topic.payment_v1_events.name
]
cert_common_name = "payment-platform/openbanking-apid"
Expand All @@ -81,11 +116,13 @@ module "openbanking_consumerd" {
produce_topics = [
kafka_topic.openbanking_deadletter_v1_internal_payments.name,
kafka_topic.openbanking_deadletter_v1_internal_payment_methods.name,
kafka_topic.openbanking_deadletter_v1_internal_settlements.name,
kafka_topic.payment_v1_events.name
]
consume_topics = [
kafka_topic.openbanking_v1_internal_payments.name,
kafka_topic.openbanking_v1_internal_payment_methods.name
kafka_topic.openbanking_v1_internal_payment_methods.name,
kafka_topic.openbanking_v1_internal_settlements.name
]
consume_groups = ["payment-platform.openbanking_consumerd"]
cert_common_name = "payment-platform/openbanking-consumerd"
Expand All @@ -96,6 +133,7 @@ module "openbanking_crond" {
produce_topics = [
kafka_topic.openbanking_v1_internal_payments.name,
kafka_topic.openbanking_v1_internal_payment_methods.name,
kafka_topic.openbanking_v1_internal_settlements.name,
kafka_topic.payment_v1_events.name
]
cert_common_name = "payment-platform/openbanking-crond"
Expand All @@ -108,12 +146,14 @@ module "payment_deadletterd" {
kafka_topic.payment_method_v1_events.name,
kafka_topic.openbanking_v1_internal_payments.name,
kafka_topic.openbanking_v1_internal_payment_methods.name,
kafka_topic.openbanking_v1_internal_settlements.name
]
consume_topics = [
kafka_topic.payment_deadletter_v1_events.name,
kafka_topic.payment_method_deadletter_v1_events.name,
kafka_topic.openbanking_deadletter_v1_internal_payments.name,
kafka_topic.openbanking_deadletter_v1_internal_payment_methods.name,
kafka_topic.openbanking_deadletter_v1_internal_settlements.name
]
consume_groups = ["payment-platform.payment-deadletterd"]
cert_common_name = "payment-platform/payment-deadletterd"
Expand Down

0 comments on commit 2068e6f

Please sign in to comment.