Skip to content

Commit 091120b

Browse files
committed
wip(worker): set host via args
1 parent f3cf9da commit 091120b

File tree

1 file changed

+8
-1
lines changed
  • payment/src/main/scala/org/camunda/worker/akka/sample/payment

1 file changed

+8
-1
lines changed

payment/src/main/scala/org/camunda/worker/akka/sample/payment/Main.scala

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ import scala.io.StdIn._
1616
*/
1717
object Main extends App {
1818

19+
// extract the host from arguments
20+
val host = if(args.size == 0) {
21+
"http://localhost:8080/engine-rest"
22+
} else {
23+
args(0)
24+
}
25+
1926
println("")
2027
println("starting...........")
2128
println("press ENTER to exit")
@@ -29,7 +36,7 @@ object Main extends App {
2936
val worker = system.actorOf(UnreliableWorker.props(delay = 200, reliability = 0.75), name = "worker-1")
3037

3138
// start polling
32-
val pollActor = system.actorOf(PollActor.props(hostAddress = "http://localhost:8080/engine-rest", maxTasks = 5, waitTime= 100, lockTime = 600), name = "poller")
39+
val pollActor = system.actorOf(PollActor.props(hostAddress = host, maxTasks = 5, waitTime= 100, lockTime = 600), name = "poller")
3340
pollActor ! Poll(topicName = "payment", worker)
3441

3542
// waiting for end

0 commit comments

Comments
 (0)