After creating the three layers around the ApiClient, Api interface
and RealTimeManager these are combined
in the @SpringBootApplication RealTimeClient.
run RealTimeClient CLI
The traccar-rt-client does not provide any webservices.
It is a plain command line interface (CLI) to connect to a traccar server
from the command line and read what’s going on.
@SpringBootApplication public class RealTimeClient implements CommandLineRunner
Therefor it is a solid building block for real time applications.
You can integrate it in your application and code against the
RealTimeManager as if it was the traccar server.
pick up the traccar-rt-client-6.10.0-RC.jar
put it in /someFolder/traccar-rt-client-6.10.0-RC.jar
(release url)
copy app.props
enter credentials
run java, mvn spring:run ..
start your traccar client or your tracker connected to traccar
watch the console over the map
If you don’t have a traccar server you can sign up at one of traccar’s demo servers.
RealTimeClient is a Spring Boot application that:
-
Starts RealTimeController on launch.
-
Reads admin credentials from application.properties.
-
Logs in as the admin user when starting.
-
Remains running until manually shutdown (e.g., Ctrl+C), and supports graceful shutdown.
modify RealTimeClient to a @SpringBootApplication that starts the RealTimeController and log in as traccar.admin.name as provided in the application.properties and can be gracefully shutdown manually
You can run the application as usual (e.g., with mvn spring-boot:run or java -jar), and it will log in and initialize the real-time controller using the configured admin credentials.