From 24b88f512697d921cb5f46c1ebc846f782fe6747 Mon Sep 17 00:00:00 2001 From: Ruhanga <41738040+Ruhanga@users.noreply.github.com> Date: Mon, 26 Feb 2024 19:18:32 +0300 Subject: [PATCH] C2C-207: Ozone Analytics to flatten Odoo data (#19) --- development/.env | 4 ++-- development/docker-compose.yaml | 1 + development/setup-connect/setup-connect.sh | 8 +++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/development/.env b/development/.env index bebdcfe..2e8cb0f 100644 --- a/development/.env +++ b/development/.env @@ -16,10 +16,10 @@ ANALYTICS_SOURCE_TABLES_PATH= ANALYTICS_QUERIES_PATH= ANALYTICS_DESTINATION_TABLES_MIGRATIONS_PATH= CHANGELOG_FILE=db.changelog-master.xml -ODOO_ANALYTICS_TABLES='databasechangelog,account_account,product_category,sale_order' +ODOO_ANALYTICS_TABLES='databasechangelog,account_account,product_category,sale_order,sale_order_line,res_partner,product_product,product_template' #Kafka -CREATE_TOPICS=openmrs.openmrs.appointment_service,openmrs.openmrs.appointment_service_type,openmrs.openmrs.care_setting,openmrs.openmrs.concept,openmrs.openmrs.concept_name,openmrs.openmrs.concept_reference_map,openmrs.openmrs.concept_reference_source,openmrs.openmrs.concept_reference_term,openmrs.openmrs.conditions,openmrs.openmrs.encounter,openmrs.openmrs.encounter_diagnosis,openmrs.openmrs.encounter_type,openmrs.openmrs.location,openmrs.openmrs.form,openmrs.openmrs.obs,openmrs.openmrs.order_type,openmrs.openmrs.orders,openmrs.openmrs.patient,openmrs.openmrs.patient_appointment,openmrs.openmrs.patient_appointment_provider,openmrs.openmrs.patient_identifier,openmrs.openmrs.patient_identifier_type,openmrs.openmrs.patient_program,openmrs.openmrs.program,openmrs.openmrs.person,openmrs.openmrs.person_attribute,openmrs.openmrs.person_attribute_type,openmrs.openmrs.person_name,openmrs.openmrs.person_address,openmrs.openmrs.visit_type,openmrs.openmrs.visit,openmrs.openmrs.visit_attribute,openmrs.openmrs.visit_attribute_type,odoo.public.sale_order +CREATE_TOPICS=openmrs.openmrs.appointment_service,openmrs.openmrs.appointment_service_type,openmrs.openmrs.care_setting,openmrs.openmrs.concept,openmrs.openmrs.concept_name,openmrs.openmrs.concept_reference_map,openmrs.openmrs.concept_reference_source,openmrs.openmrs.concept_reference_term,openmrs.openmrs.conditions,openmrs.openmrs.encounter,openmrs.openmrs.encounter_diagnosis,openmrs.openmrs.encounter_type,openmrs.openmrs.location,openmrs.openmrs.form,openmrs.openmrs.obs,openmrs.openmrs.order_type,openmrs.openmrs.orders,openmrs.openmrs.patient,openmrs.openmrs.patient_appointment,openmrs.openmrs.patient_appointment_provider,openmrs.openmrs.patient_identifier,openmrs.openmrs.patient_identifier_type,openmrs.openmrs.patient_program,openmrs.openmrs.program,openmrs.openmrs.person,openmrs.openmrs.person_attribute,openmrs.openmrs.person_attribute_type,openmrs.openmrs.person_name,openmrs.openmrs.person_address,openmrs.openmrs.visit_type,openmrs.openmrs.visit,openmrs.openmrs.visit_attribute,openmrs.openmrs.visit_attribute_type,odoo.public.sale_order,odoo.public.sale_order_line,odoo.public.res_partner,odoo.public.product_product,odoo.public.product_template # Postgresql POSTGRES_USER=postgres diff --git a/development/docker-compose.yaml b/development/docker-compose.yaml index 09d682a..95c7308 100644 --- a/development/docker-compose.yaml +++ b/development/docker-compose.yaml @@ -66,6 +66,7 @@ services: - 8383:8083 volumes: - ./debezium-connect/jars/TimestampConverter-1.2.4-SNAPSHOT.jar:/kafka/connect/debezium-connector-mysql/TimestampConverter-1.2.4-SNAPSHOT.jar + - ./debezium-connect/jars/TimestampConverter-1.2.4-SNAPSHOT.jar:/kafka/connect/debezium-connector-postgres/TimestampConverter-1.2.4-SNAPSHOT.jar environment: - BOOTSTRAP_SERVERS=kafka:9092 - GROUP_ID=1 diff --git a/development/setup-connect/setup-connect.sh b/development/setup-connect/setup-connect.sh index bf75bd1..f313013 100644 --- a/development/setup-connect/setup-connect.sh +++ b/development/setup-connect/setup-connect.sh @@ -42,10 +42,16 @@ curl --fail -i -X PUT -H "Accept:application/json" -H "Content-Type:application/ "plugin.name": "pgoutput", "database.server.name": "odoo", "table.include.list": "public.(.*)", + "converters": "timestampConverter", + "timestampConverter.type": "oryanmoshe.kafka.connect.util.TimestampConverter", + "timestampConverter.format.time": "HH:mm:ss", + "timestampConverter.format.date": "YYYY-MM-dd", + "timestampConverter.format.datetime": "yyyy-MM-dd HH:mm:ss", + "timestampConverter.debug": "false", "key.converter": "org.apache.kafka.connect.json.JsonConverter", "key.converter.schemas.enable": "true", "heartbeat.interval.ms": "5000", "slot.name": "odoo_debezium", "publication.name": "odoo_publication", "decimal.handling.mode": "double" - }' \ No newline at end of file + }'