Skip to content

terasoluna-batch/atrs-batch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Airline Ticket Reservation System (ATRS)

GitHub

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).

How to run the application

Get the Source Code

Clone the project repository from GitHub to obtain the required resources.

$ git clone https://github.com/terasoluna-batch/atrs-batch.git

Move to the project directory after cloning:

$ cd ${your-cloned-directory}

Install PostgreSQL

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=# \q

Insert test data

Execute the following command to create tables and insert test data:

$ mvn sql:execute

If the process completes successfully, 「~ statements executed successfully」will be displayed.

Build

Execute the following command to build the application artifacts:

$ mvn clean package

The 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.

Run sample jobs

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.

Run synchronous batch jobs

The following synchronous batch jobs are provided.

  • Update flight information

for CommandPrompt(Windows)

$ scripts\JBBA01001.bat

for Bash(Unix, Linux, …​)

$ scripts/JBBA01001.sh
  • Export flight information

for CommandPrompt(Windows)

$ scripts\JBBA02001.bat

for Bash(Unix, Linux, …​)

$ scripts/JBBA02001.sh

Run asynchronous batch jobs

The following batch jobs run asynchronously:

  • Start AsyncBatchDaemon

for CommandPrompt(Windows)

$ scripts\startAsyncBatchDaemon.bat

for 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 20260401

for Bash(Unix, Linux, …​)

$ scripts/aggregateReservation.sh 20260301 20260401

NOTE:
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.bat

for Bash(Unix, Linux, …​)

$ scripts/stopAsyncBatchDaemon.sh

About

TERASOLUNA Batch Framework for Java (5.x) sample application.

Resources

License

Stars

1 star

Watchers

26 watching

Forks

Packages

 
 
 

Contributors

Languages