Simple receiver of ODF messages, compliant with odf.olympictech.org
-
Decoupled message receiving and processing. An HTTP response is sent immediately upon receving a message, to avoid stalling the sender. Message processing is done in a separate thread
-
Messages are stored in three folders
-
tmp
Stores messages when they are received. Processed messages can be moved to this folder for reprocessing. File name is the received timestamp -
messages
Processed messages, grouped in folders by day. File name includes ODF header attribues and the received timestamp -
error
Files intmp
folder having an unrecognized file name
-
-
tmp
folder is monitored for new files, any file copied in that folder will be processed. Useful to reprocess messages -
Full help provided by
--help
option -
Implemented HTTP paths and methods
-
GET /
Provides a help message to validate that application is up and running -
POST /
Consumes the request and ignores it. Useful as dummy client just to validate end-to-end sender -
POST /odf
ODF Messages are stored and processed
-
Two reasons:
-
Allows to reprocessing messages by just putting them in the tmp folder
-
If the processing is slow, a crash of the app would not result in lost messages
This app is just an example, a template which can be extended with now complex (slower) processing, such as saving to DB