Message Brokers

Kafka is used as the message brokers between services. There are currently 4 topics:

Topic Description Producers Consumers
logs Service activity logs data on creating, updating, and deleting model from all services. This data is processed by Activity Log service to be processed further as audit trail logs. All services Activity Log Service
transactions All wallet transactions data. Wallet Service Report Service
rounds Game round transactions data with a detailed information on the round played. Wallet Service Report Service
registrations Player registration data. Player Service Report Service

To handle multitanency, topics are set different between operators in the format of [OPERATOR-CODE]-[TOPIC]. For example, operator dev will have the topic name of dev-transactions for the transactions topic.

Local Development or Debugging

In case you need to run a consumer for the Kafka in the development or staging environment in your local server, set your consumer group ID to the following format:

[YOUR-NAME]-[SERVICE-NAME]

Eg: You are trying to debug transactions consumer process in the local server by using Kafka in the development server. Set your CONSUMER_GROUP_ID variable to john-report-service.

Connecting to Kafka from all services will require you to have the CA, KEY, and PEM files and refer the path in the environment variables. If you have the access to the Aiven console, you can get the value from the projects. If you don't, contact the developers.

Local Development or Debugging

Kafka Development VM: https://console.cloud.google.com/compute/instancesDetail/zones/asia-southeast1-a/instances/kafka-1?project=provider-serverless

Kafka Brokers URL: 35.240.246.157:9091

Kafka UI: 35.240.246.157:8080

Connecting to Kafka from some services may require you to have the CA, KEY, and PEM files and refer the path in the environment variables. If you have the access to the Aiven console, you can get the value from the projects. If you don't, contact the developers.

Environment Variables

Name Value
KAFKA_BROKERS_URL igaming-prod-v1-gigaming-eb41.aivencloud.com:25762
KAFKA_KEY_PATH refer to your onboarding attachment
KAFKA_PEM_PATH refer to your onboarding attachment
KAFKA_CERT_PATH refer to your onboarding attachment

Kafka Message Commands

Kafka messages can be replayed by using the following curl commands

Replay Kafka round message

curl --request POST \ --url https://uno.unoapi.com/report/consume \ --header 'content-type: application/json' \ --data '{"stopTimestamp": 1672851599}'

Set scout consumer offset commit

curl --request POST \ --url https://uno.unoapi.com/report/create-and-commit \ --header 'content-type: application/json' \ --data '{"brokerUrl": "igaming-whitelabel-gigaming-eb41.aivencloud.com:25762", "reqCert": true, "certPath":"\/kafka\/cert\/aiven-kafka-cert", "keyPath":"\/kafka\/key\/aiven-kafka-key", "pemPath":"\/kafka\/pem\/aiven-kafka-ca-pem", "partition":0, "offset": 109510000}'

Delete past 3 monts data

curl --request POST \ --url https://uno.unoapi.com/report/delete-3-months-data \ --header 'content-type: application/json' \ --data '{"collection": "transactions"}'