intercept Service
The intercept service relays messages between CentralEGA and Federated EGA nodes.
Service Description
When running, intercept reads messages from the configured RabbitMQ queue (commonly: from_cega).
For each message, these steps are taken:
- The message type is read from the message
typefield. - If the message
typeis not known, an error is logged and the message is Ack'ed. - The correct queue for the message is decided based on message type.
- The message is sent to the queue.
- This has no error handling as the resend-mechanism hasn't been finished.
- The message is Ack'ed.
- If the message type is of unknown type, we acknowledge it and send it to
catch_all.dead(needs to exist)
Communication
Interceptreads messages from one queue (commonly:from_cega).Interceptpublishes messages to three queues,accession,ingest, andmappings.
Configuration
There are a number of options that can be set for the intercept service.
These settings can be set by mounting a yaml-file at /config.yaml with settings.
ex.
log:
level: "debug"
format: "json"
They may also be set using environment variables like:
export LOG_LEVEL="debug"
export LOG_FORMAT="json"
RabbitMQ broker settings
These settings control how intercept connects to the RabbitMQ message broker.
BROKER_HOST: hostname of the RabbitMQ serverBROKER_PORT: RabbitMQ broker port (commonly:5671with TLS and5672without)BROKER_QUEUE: message queue to read messages from (commonly:from_cega)BROKER_USER: username to connect to RabbitMQBROKER_PASSWORD: password to connect to RabbitMQ
Logging settings
LOG_FORMATcan be set to “json” to get logs in json format, all other values result in text logging.LOG_LEVELcan be set to one of the following, in increasing order of severity:tracedebuginfowarn(orwarning)errorfatalpanic