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
type
field. - If the message
type
is 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
Intercept
reads messages from one queue (commonly:from_cega
).Intercept
publishes 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:5671
with TLS and5672
without)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_FORMAT
can be set to “json” to get logs in json format, all other values result in text logging.LOG_LEVEL
can be set to one of the following, in increasing order of severity:trace
debug
info
warn
(orwarning
)error
fatal
panic