Categorygithub.com/ONSdigital/dp-search-reindex-tracker

# README

dp-search-reindex-tracker

dp-search-reindex-tracker tracks the progress of a search reindex job

See search service architecture docs here

Getting started

  • Run make help to see full list of make targets
  • Run make debug

The Search Reindex Tracker service runs in the background consuming messages from Kafka.

The following diagram shows how the Search Reindex Tracker will be used to track the progress of search reindex jobs and their tasks: Search Reindex Pipeline

The topics will produce the following messages:

  • The Search Reindex API will produce messages, for the reindex-requested topic, that request new search reindex jobs. The Search Reindex tracker will consume these and set the state of the relevant search reindex jobs to "in-progress".
  • The Search Data Finder will produce messages for the reindex-task-counts topic. The Search Reindex tracker will consume these in order to set the "total search documents" number for the relevant search reindex jobs.
  • The Search Data Importer will produce messages for the search-data-imported topic. The Search Reindex Tracker will consume these in order to set the "total inserted search documents" number for the relevant search reindex jobs.

Dependencies

  • Requires running…
  • No further dependencies other than those defined in go.mod

Configuration

Environment variableDefaultDescription
BIND_ADDRlocalhost:28500The host and port to bind to
GRACEFUL_SHUTDOWN_TIMEOUT5sThe graceful shutdown timeout in seconds (time.Duration format)
HEALTHCHECK_INTERVAL30sTime between self-healthchecks (time.Duration format)
HEALTHCHECK_CRITICAL_TIMEOUT90sTime to wait until an unhealthy dependent propagates its state to make this app unhealthy (time.Duration format)
KAFKA_ADDR"localhost:9092"The address of Kafka (accepts list)
KAFKA_OFFSET_OLDESTtrueStart processing Kafka messages in order from the oldest in the queue
KAFKA_NUM_WORKERS1The maximum number of parallel kafka consumers
KAFKA_REINDEX_REQUESTED_GROUPdp-search-reindex-trackerThe consumer group name for reindex requested events
KAFKA_REINDEX_REQUESTED_TOPICreindex-requestedThe topic name for reindex requested events
KAFKA_REINDEX_TASK_COUNTS_GROUPdp-search-reindex-trackerThe consumer group name for reindex task count events
KAFKA_REINDEX_TASK_COUNTS_TOPICreindex-task-countsThe topic name for reindex task count events
KAFKA_SEARCH_DATA_IMPORTED_GROUPdp-search-reindex-trackerThe consumer group name for search data imported events
KAFKA_SEARCH_DATA_IMPORTED_TOPICsearch-data-importedThe topic name for search data imported events
KAFKA_SEC_PROTOunsetif set to TLS, kafka connections will use TLS (kafka TLS doc)
KAFKA_SEC_CA_CERTSunsetCA cert chain for the server cert (kafka TLS doc)
KAFKA_SEC_CLIENT_KEYunsetPEM for the client key (kafka TLS doc)
KAFKA_SEC_CLIENT_CERTunsetPEM for the client certificate (kafka TLS doc)
KAFKA_SEC_SKIP_VERIFYfalseignores server certificate issues if true (kafka TLS doc)

Healthcheck

The /health endpoint returns the current status of the service. Dependent services are health checked on an interval defined by the HEALTHCHECK_INTERVAL environment variable.

On a development machine a request to the health check endpoint can be made by:

curl localhost:8125/health

Contributing

See CONTRIBUTING for details.

License

Copyright © 2022, Office for National Statistics (https://www.ons.gov.uk)

Released under MIT license, see LICENSE for details.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

BuildTime represents the time in which the service was built.
GitCommit represents the commit (SHA-1) hash of the service that is running.
Version represents the version of the service that is running.