Airline Ticket Reservation System (ATRS) is a sample application for developers to learn how to make applications with TERASOLUNA Batch Framework for Java (5.x).
Clone the project repository from GitHub to obtain the required resources.
$ git clone https://github.com/terasoluna-batch/atrs-batch.gitMove to the project directory after cloning:
$ cd ${your-cloned-directory}You need to create a database of PostgreSQL on a local machine. (PostgreSQL can be downloaded from its official website.)
Create a database with the following settings:
| Property | Value |
|---|---|
| database name | atrs_batch |
| user name | postgres |
| password | postgres |
Example (psql):
$ psql postgres postgres
postgres=# CREATE DATABASE atrs_batch WITH ENCODING = 'UTF8';
postgres=# \qExecute the following command to create tables and insert test data:
$ mvn sql:executeIf the process completes successfully, 「~ statements executed successfully」will be displayed.
Execute the following command to build the application artifacts:
$ mvn clean packageThe distribution archive will be generated under:
atrs-batch/target/atrs-batch-${version}-distribution.zip
※ ${version} is the value defined in pom.xml.
This completes the application build.
Before running jobs, make sure the distribution archive generated by the build has been extracted to any directory.
Run the following commands from the extracted distribution directory
(e.g. atrs-batch-${version}).
Change the current directory to the extracted distribution directory:
for CommandPrompt(Windows)
$ cd atrs-batch-${version}for Bash(Unix, Linux, …)
$ cd atrs-batch-${version}※ ${version} is the value defined in pom.xml.
The following synchronous batch jobs are provided.
- Update flight information
for CommandPrompt(Windows)
$ scripts\JBBA01001.batfor Bash(Unix, Linux, …)
$ scripts/JBBA01001.sh- Export flight information
for CommandPrompt(Windows)
$ scripts\JBBA02001.batfor Bash(Unix, Linux, …)
$ scripts/JBBA02001.shThe following batch jobs run asynchronously:
- Start AsyncBatchDaemon
for CommandPrompt(Windows)
$ scripts\startAsyncBatchDaemon.batfor Bash(Unix, Linux, …)
$ scripts/startAsyncBatchDaemon.sh- Submit job requests
Open another command prompt, change to the same directory, and execute the job request script with start date and end date in yyyyMMdd format.
for CommandPrompt(Windows)
$ scripts\aggregateReservation.bat 20260301 20260401for Bash(Unix, Linux, …)
$ scripts/aggregateReservation.sh 20260301 20260401NOTE:
The aggregation start date and end date to be specified vary depending on the actual date (≈ system date) when the test data was inserted. If the actual date is within March 2026, the aggregation start date is 2026/02/01 (the first day of the previous month) and the aggregation end date is 2026/03/01 (the first day of the current month), as shown in the command example above.
- Stop AsyncBatchDaemon
After all jobs have completed, stop the daemon.
for CommandPrompt(Windows)
$ scripts\stopAsyncBatchDaemon.batfor Bash(Unix, Linux, …)
$ scripts/stopAsyncBatchDaemon.sh