A microservice that read a kafka queue for import automacically all open attendances on ADempiere
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
apt install pkg-config openssl libssl-dev sqlite3 libsqlite3-dev
apt install sqlite3
apt install libsqlite3-dev
On Windows Diesel require "sqlite3.lib" dependency
To Generate is need follow next steps:
choco install vcredist-all
choco install visualstudio2019community
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\amd64
lib /def:sqlite3.def /machine:X64 /out:sqlite3.lib
That will create two files
sqlite3.exp
sqlite3.lib
then these files should be copied to the following path on the project
target\debug\deps
cargo install diesel_cli --no-default-features --features sqlite
echo DATABASE_URL=time_attendance.db > .env
diesel setup
diesel migration generate setup
diesel migration run
diesel migration redo
You can build images using the follow command
docker build -t play-backend-rs-rs -f docker/Dockerfile .
After build just run it
docker run -d -p 7878:7878 --name play-backend-rs -e KAFKA_HOST=0.0.0.0:9092 -e KAFKA_GROUP=default KAFKA_ATTENDANCE_QUEUE="attendances" play-backend-rs-rs
DB_HOST: Hostname for data base server. Default: localhostDB_PORT: Port used by data base server. Default: 5432DB_NAME: Database name that adempiere-middleware will use to connect with the database. Default: adempiereDB_USER: Database user that adempiere-middleware will use to connect with the database. Default: adempiereDB_PASSWORD: Database password that Adempiere-Backend will use to connect with the database. Default: adempiereADEMPIERE_BACKEND_ENDPOINT: Backend endpoint for all request to ADempiere, default is http://0.0.0.0:7878/entitiesADEMPIERE_AUTHORIZATION: Private key used for validate sign with JWT, default Bearer. This throw a error if is notr settedRUST_LOG: The log level for service. Default infoTZ: (Time Zone) Indicates the time zone to set in the nginx-based container, the default value is America/Caracas (UTC -4:00).Just build it and run
cargo build
cargo run --bin admin_server
A output generated by the Arduino UNO emulator can be like it:
Server Address: "0.0.0.0:7878"
└──!NULL!
└──attendances
└──[POST] -> server::create_attendance
Content type
Image
Digest
sha256:0e637c900…
Size
94.3 MB
Last updated
about 3 years ago
docker pull erpya/play-backend-rs