簡體   English   中英

從Windows批處理文件調用Apache Camel Spring Boot應用程序

[英]Calling an Apache Camel Spring Boot Application from Windows Batch file

我開發了一個使用Apache Camel的Spring Boot應用程序,該應用程序可以在我的IDE IntelliJ IDEA中正常運行。

我的路線非常簡單,因為我只想將一個文件從A點移動到B點。只要在application.properties中配置了我的Camel-Endpoints,一切就可以正常工作並且文件已成功移動。

現在,我想嘗試從Windows Batch文件中調用相同的應用程序,並通過命令行參數覆蓋Camel端點屬性。

我的.bat文件如下所示:

@echo off
set /p quelle="Quellverzeichnis: "
set /p ziel="Zielverzeichnis: "

java -jar -DQuelle=file://%quelle%?consumer.bridgeErrorHandler=true&idempotent=true&moveFailed=.\fehler&move=.\verarbeitet&maxMessagesPerPoll=1 -DZiel=file://%ziel% myapp.jar

pause

根據文檔,應通過-D設置駱駝屬性: https : //camel.apache.org/spring-boot.html

但是當我執行此命令時,我只能從命令行獲得如何定義命令的幫助。 當我將其更改為彈簧啟動的屬性,我得到了錯誤的命令idempotentmoveFailedmaxMessagesPerPoll是未知的:

@echo off
set /p quelle="Quellverzeichnis: "
set /p ziel="Zielverzeichnis: "

java -jar myapp.jar --Quelle=file://%quelle%?consumer.bridgeErrorHandler=true&idempotent=true&moveFailed=.\fehler&move=.\verarbeitet&maxMessagesPerPoll=1 --Ziel=file://%ziel%

pause 

我的問題是:當我從命令行調用應用程序時,如何定義駱駝端點?

jvm參數需要放在-jar之前

java -DQuelle=file://%quelle%?consumer.bridgeErrorHandler=true&idempotent=true&moveFailed=.\fehler&move=.\verarbeitet&maxMessagesPerPoll=1 -DZiel=file://%ziel% -jar  myapp.jar

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM