User-Agent parser v4 microservice with a REST API, intended to run in Docker.
Udger-local-api-v4 is an application that runs a scalable pool of Udger parsers. It exposes a REST API, can be easily containerized with Docker, and used as a microservice. The project provides a basic Dockerfile based on Alpine Linux and uses Meecrowave (Jakarta EE/MicroProfile) for high efficiency.
The project consists of the following components:
- REST API description in OpenAPI format.
- Java 17 Maven project, running on Java 25 in Docker.
- Dockerfile based on AlpineLinux + Java 25 with the Meecrowave microprofile.
- Simple build & run script. Builds the project, builds the Docker image, and runs the Docker container.
- Testing scripts in Python.
- Hosted Docker image on Docker Hub.
- Run the
buildAndRun.shscript.
Udger-local-api-v4 can be configured using the following Java system properties:
-Dudger.poolsize=NwhereNis the number of parsers in the pool. Default:5.-Dudger.cachesize=NwhereNis the number of items in the parser’s LRU cache. Default:10000.-Dudger.clientkey=KEYwhereKEYis the client key used to access the DB file fromhttp://data.udger.com/. Default: empty.-Dudger.db=dbFilewheredbFileis the path to the database file. Default:/udgerdb/udgerdb_v4.dat.-Dudger.autoupdate.time=4:42schedules the daily auto-update time (HH:mm format), e.g.,04:42.
- Replace
udgerdb_test_v4.datwith the full databaseudgerdb_v4.datin theDockerfile.
parse/ua
wget http://localhost:8080/udger-local-api-v4/parse/ua/Mozilla%2F5.0+%28Windows+NT+10.0%3B+WOW64%3B+rv%3A40.0%29+Gecko%2F20100101+Firefox%2F40.0
parse/ua-v4
curl -X POST -H "Content-Type: application/xml" -d '<parseUaV4Request>
<uaString></uaString>
<secChUa>" Not;A Brand";v="99", "Google Chrome";v="97", "Chromium";v="97"</secChUa>
<secChUaFullVersionList></secChUaFullVersionList>
<secChUaMobile>?0</secChUaMobile>
<secChUaFullVersion>"97.0.4692.71"</secChUaFullVersion>
<secChUaPlatform></secChUaPlatform>
<secChUaPlatformVersion></secChUaPlatformVersion>
<secChUaModel></secChUaModel>
</parseUaV4Request>' http://localhost:8080/udger-local-api-v4/parse/ua-v4
parse/ip
wget http://localhost:8080/udger-local-api-v4/parse/ip/12.118.188.126
statistic
wget http://localhost:8080/udger-local-api-v4/statistic
set/updatedata
curl -F 'file=@udgerdb_v4.dat' http://127.0.0.1:8080/udger-local-api-v4/set/datafile