1 Star 0 Fork 0

wangyin/optaplanner-quickstarts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.adoc 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

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/java_wangyin/optaplanner-quickstarts.git
git@gitee.com:java_wangyin/optaplanner-quickstarts.git
java_wangyin
optaplanner-quickstarts
optaplanner-quickstarts
8.x

搜索帮助