使用多个上下文将 Immutant 部署到 WildFly

Deploying Immutant to WildFly with several contexts

我有一个带有 Immutant (Clojure) 的 Undertow Web 服务器,我的 main- 看起来像这样:

(run
  (-> routes/app
    wrap-something-app-specific
    wrap-params)
  (options
    {:path "/" :port 8080}))

(run
  (-> routes/billing
    wrap-something-billing-specific)
  (options
    {:path "/billing" :port 8081
     :worker-threads 4}))

当 运行 不在 WildFly countainer 中时,它工作得很好:localhost:8080/ 映射到应用程序路由,localhost:8081/billing 映射到计费路由。 但是,当我确实以 ROOT 身​​份部署到 WildFly 时,我只能使一个上下文工作,而不能同时工作。我已经尝试了 :path / :port 参数的所有组合。 WildFly 日志包括:

13:07:46,295 INFO  [org.projectodd.wunderboss.web.Web] (MSC service thread 1-12) Registered web context /billing
13:07:46,308 INFO  [org.projectodd.wunderboss.web.Web] (MSC service thread 1-12) Registered web context /
................
13:07:46,325 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-12) JBAS017534: Registered web context: /

那么如何让 Undertow 注册这两个上下文?

这不是解决方案,但可以提示您正在发生的事情。 从 Immutant/WildFly documentation 看来,您的问题可能来自部署和 运行 到 WildFly 时的此限制:

When running inside WildFly, the :host and :port options to immutant.web/run are silently ignored since your handlers are mounted on WildFly’s internal Undertow server, bound to whatever host/port it’s been configured for.