Skip to content

Latest commit

 

History

History
142 lines (110 loc) · 2.82 KB

File metadata and controls

142 lines (110 loc) · 2.82 KB

School Timetabling (Java, ActiveMQ, Quarkus, Maven)

The quickstart consists of two modules:

  • Client runs the UI and sends requests to the Solver Server via ActiveMQ.

  • Solver Server optimizes the requests sent via an ActiveMQ queue and sends results back to ActiveMQ broker.

Run the application with live coding

  1. Git clone the optaplanner-quickstarts repo:

    $ git clone https://github.com/kiegroup/optaplanner-quickstarts.git
    ...
    $ cd optaplanner-quickstarts/technology/java-activemq-quarkus
  2. Build the project:

    $ mvn clean install
  3. Install docker and docker-compose.

  4. Start the ActiveMQ broker, the Solver Server, and Client application with the run.sh script, which starts all 3 processes:

    $ ./run.sh
  5. Visit http://localhost:8080 in your browser.

  6. Click on the Solve button.

In case of any error, please check the log files located in java-activemq-quarkus/target.

Then try live coding:

  1. Make some changes in the source code.

  2. Refresh your browser (F5).

Notice that those changes are immediately in effect.

Package and run the application

When you’re done iterating in quarkus:dev mode, run the application as a conventional jar file. Before running any application, start the ActiveMQ broker:

$ docker-compose up

Package and run the Solver Server application

  1. Compile it with Maven:

    $ cd solver
    $ mvn package -DskipTests
  2. Run it:

    $ java -Dquarkus.http.port=8081 -jar ./target/quarkus-app/quarkus-run.jar
Note
Use the custom port to avoid conflict with the Client application.

Package and run the Client application

  1. Compile it with Maven:

    $ cd client
    $ mvn package -DskipTests
  2. Run it:

    $ java -jar ./target/quarkus-app/quarkus-run.jar
  3. Visit http://localhost:8080 in your browser.

Run a native executable

Compile and run the Solver Server application natively

  1. Compile the Solver Server application natively:

    $ cd solver
    $ mvn package -Dnative -DskipTests
  2. Run the native executable:

    $ ./target/*-runner -Dquarkus.http.port=8081

Compile and run the Client application natively

  1. Compile the Client application natively:

    $ cd client
    $ mvn package -Dnative -DskipTests
  2. Run the native executable:

    $ ./target/*-runner
  3. Visit http://localhost:8080 in your browser.

More information