Categorygithub.com/ONSdigital/dp-search-data-finder
modulepackage
0.7.0
Repository: https://github.com/onsdigital/dp-search-data-finder.git
Documentation: pkg.go.dev

# README

dp-search-data-finder

Receives events requesting reindex jobs and finds data to populate the new indexes created

Getting started

  • Run make debug

The service runs in the background consuming messages from Kafka. An example event can be created using the helper script, make produce.

Dependencies

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

Configuration

Environment variableDefaultDescription
BIND_ADDR"localhost:28000"The host and port to bind to
CONTENT_UPDATED_TOPIC_FLAGfalseproduce events only if set to true
GRACEFUL_SHUTDOWN_TIMEOUT5sThe graceful shutdown timeout in seconds (time.Duration format)
HEALTHCHECK_CRITICAL_TIMEOUT90sTime to wait until an unhealthy dependent propagates its state to make this app unhealthy (time.Duration format)
HEALTHCHECK_INTERVAL30sTime between self-healthchecks (time.Duration format)
KAFKA_ADDR"localhost:9092"The address of Kafka (accepts list)
KAFKA_CONTENT_UPDATED_TOPIC"content-updated"The name of the topic to produce messages for
KAFKA_NUM_WORKERS1The maximum number of parallel kafka consumers
KAFKA_OFFSET_OLDESTtrueStart processing Kafka messages in order from the oldest in the queue
KAFKA_REINDEX_REQUESTED_GROUP"dp-search-data-finder"The consumer group for this application to consume reindex-requested messages
KAFKA_REINDEX_REQUESTED_TOPIC"reindex-requested"The name of the topic to consume messages from
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_CERTunsetPEM for the client certificate (kafka TLS doc)
KAFKA_SEC_CLIENT_KEYunsetPEM for the client key (kafka TLS doc)
KAFKA_SEC_SKIP_VERIFYfalseignores server certificate issues if true (kafka TLS doc)
KAFKA_VERSION"1.0.2"The kafka version that this service expects to connect to
ZEBEDEE_CLIENT_TIMEOUT30sTime to wait for the zebedee client to respond to requests e.g. the published index request
ZEBEDEE_URLhttp://localhost:8082The URL to zebedee

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:28000/health

Content Updated Topic

a. To check if service produced an event for content-updated Topic

make test

b. set EnablePublishContentUpdatedTopic in config as true/false

c. build and run the service go build ./dp-search-data-finder

d. Send the event make produce Type uri (any text)

e. Check the service logs if either of the following appears and there is no error in service logs
EnablePublishContentUpdatedTopic Flag is enabled/disabled

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
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.