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.
-
Git clone the optaplanner-quickstarts repo:
$ git clone https://github.com/kiegroup/optaplanner-quickstarts.git ... $ cd optaplanner-quickstarts/technology/java-activemq-quarkus
-
Build the project:
$ mvn clean install
-
Install docker and docker-compose.
-
Start the ActiveMQ broker, the Solver Server, and Client application with the
run.sh
script, which starts all 3 processes:$ ./run.sh
-
Visit http://localhost:8080 in your browser.
-
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:
-
Make some changes in the source code.
-
Refresh your browser (F5).
Notice that those changes are immediately in effect.
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
-
Compile it with Maven:
$ cd solver $ mvn package -DskipTests
-
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. |
-
Compile it with Maven:
$ cd client $ mvn package -DskipTests
-
Run it:
$ java -jar ./target/quarkus-app/quarkus-run.jar
-
Visit http://localhost:8080 in your browser.
-
Compile the Solver Server application natively:
$ cd solver $ mvn package -Dnative -DskipTests
-
Run the native executable:
$ ./target/*-runner -Dquarkus.http.port=8081
-
Compile the Client application natively:
$ cd client $ mvn package -Dnative -DskipTests
-
Run the native executable:
$ ./target/*-runner
-
Visit http://localhost:8080 in your browser.
Visit www.optaplanner.org.