Skip to content

Commit

Permalink
MOSIP-29932 trying to fix this issue (#80)
Browse files Browse the repository at this point in the history
* MOSIP-27967 trying to fix autoupdate issue

Signed-off-by: Mayura Deshmukh <[email protected]>

* MOSIP-29376 biometric quality reports

Signed-off-by: Mayura Deshmukh <[email protected]>

* MOSIP-29932 trying to fox this issue

Signed-off-by: Mayura Deshmukh <[email protected]>

---------

Signed-off-by: Mayura Deshmukh <[email protected]>
  • Loading branch information
mayuradesh committed Oct 25, 2023
1 parent 35723ec commit 32f507f
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# these following will be taken from env
#DB_USER=
#DB_PORT=
#DB_HOSTNAME=
#DB_PASS=
#DB_PREFIX_INDEX=
#ES_URL=

CONN_NAME="toolkit_biometric_scores_new_$DB_PREFIX_INDEX"; # change this.. give unique name for each db/table

ES_CONN_URL='es-connect:8083'; # needn't change .. this is the ES-connector service name

DB_NAME='mosip_toolkit'; # change this
DB_TABLES='toolkit.biometric_scores_new'
ES_INDICES=$(echo $DB_TABLES | sed -E "s/([^,]+)/$DB_PREFIX_INDEX.\1/g")

curl \
-X POST \
http://$ES_CONN_URL/connectors \
-H 'Content-Type: application/json' \
-d \
'{
"name": '\"$CONN_NAME\"',
"config": {
"connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector",
"name": '\"$CONN_NAME\"',
"connection.url": '\"$ES_URL\"',
"tasks.max": "1",
"topics": '\"$ES_INDICES\"',
"key.ignore": "false",
"schema.ignore": "true",
"key.converter": "org.apache.kafka.connect.storage.StringConverter",
"value.converter": "org.apache.kafka.connect.json.JsonConverter",
"key.converter.schemas.enable": "false",
"value.converter.schemas.enable": "true",

"behavior.on.null.values": "DELETE",

"transforms": "debezExtract,tsconvert01,tsSelect",

"transforms.debezExtract.type": "io.debezium.transforms.ExtractNewRecordState",
"transforms.debezExtract.delete.handling.mode": "drop",
"transforms.debezExtract.drop.tombstones": "false",
"transforms.debezExtract.add.fields": "source.ts_ms:ts_ms,table,lsn",
"transforms.debezExtract.add.fields.prefix": "source_",

"transforms.tsconvert01.type": "io.mosip.kafka.connect.transforms.TimestampConverterAdv$Value",
"transforms.tsconvert01.field": "cr_dtimes",
"transforms.tsconvert01.input.type": "micro_sec",

"transforms.tsSelect.type": "io.mosip.kafka.connect.transforms.TimestampSelector$Value",
"transforms.tsSelect.ts.order": "cr_dtimes",
"transforms.tsSelect.output.field": "@timestamp_gen"

}
}';
2 changes: 1 addition & 1 deletion scripts/values-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ debezium_connectors:
- name: "mosip_idrepo"
tables: "idrepo.anonymous_profile,idrepo.channel_info"
- name: "mosip_toolkit"
tables: "toolkit.sbi_projects,toolkit.sdk_projects,toolkit.abis_projects,toolkit.collections,toolkit.collection_testcase_mapping,toolkit.testcase,toolkit.test_run,toolkit.test_run_details,toolkit.biometric_scores"
tables: "toolkit.sbi_projects,toolkit.sdk_projects,toolkit.abis_projects,toolkit.collections,toolkit.collection_testcase_mapping,toolkit.testcase,toolkit.test_run,toolkit.test_run_details,toolkit.biometric_scores,toolkit.biometric_scores_new"

es_kafka_connectors:
enabled: true
Expand Down

0 comments on commit 32f507f

Please sign in to comment.