4

I'm interested in the embedded undertow technology because then I don't have to reconfigure standalone.xml every time my project changes of machines. I can then just run the .jar.

So I have 2 questions:

  • Can I keep wildfly configuration inside a war (ssl, security, ports, datasource, driver and all the annoying stuff)? The idea would be to be able to download a fresh copy of wildfly, drop the war in it and it would just run (no need to mess with standalone.xml once again).
  • Is there a performance hit (or gain) by using an embedded server over a full blown web server like wildfly FULL? (assuming I'm importing needed jars in the war for the embedded server)

Edit: from the comment chain below

I wasn't clear enough. Say I have a web app called webapp.war. Assume I also move it around between different cloud platform. Each time I try another cloud platform, I have to redownload wildfly and reconfigure standalone.xml if I use wildfly server instead of undertow embedded. If however I use undertow embedded, I can do the configuration ONCE in the embedded server that is part of the app jar (that links to webapp.war). I wanna skip this whole configuration each time I change a cloud platform. So my 2 questions were : Is it possible to have a scenario under wildfly where the conf is part of my project and not the server. And the second question was : If I can't do that with wildfly, then I can do it with undertow embedded API. However I'm afraid there is a performance cost to that. Is that the case ?

Ced
  • 15,847
  • 14
  • 87
  • 146

1 Answers1

2

Undertow is a Servlet container. By itself it doesn't know what WildFly is or how to configure anything based on the standalone.xml. If you're just wanting an executable JAR I'd suggest having a look at WildFly Swarm.

James R. Perkins
  • 16,800
  • 44
  • 60
  • I'm not sure we are totally on the same page. I took a look at swarm before asking. However it seems like it still needs configuration. I'm gonna try it out tonight or tomorrow. Concerning undertow, to be sure that there is no misunderstanding, I'm talking about the embedded api. Where you can pretty much ( I think ) configure anything that I mentioned in the app jar itself. I tried out undertow and I liked it but I was worried if there could be any performance hit by using that instead of a "real" web server. – Ced Jun 22 '16 at 20:30
  • I think I am misunderstanding. By embedded API are you referring to Undertow's embedded API or WildFly Embedded? – James R. Perkins Jun 22 '16 at 22:36
  • The undertow embedded API. Like here http://undertow.io/undertow-docs/undertow-docs-1.3.0/index.html . It says `There and two main ways that Undertow can be used, either by directly embedding it in your code, or as part of the Wildfly Application Server. ` I'm talking about embedding into my code – Ced Jun 22 '16 at 23:22
  • Okay. If you do that you won't get anything WildFly provides. Which is fine, but you mentioned something about a `standalone.xml` so I thought maybe you were looking for WildFly stuff as well :) IOW WildFly uses Undertow, Undertow does not use WildFly. – James R. Perkins Jun 22 '16 at 23:47
  • I wasn't clear enough. Say I have a web app called webapp.war. Assume I also move it around between different cloud platform. Each time I try another cloud platform, I have to redownload wildfly and reconfigure standalone.xml if I use wildfly server instead of undertow embedded. If however I use undertow embedded, I can do the configuration ONCE in the embedded server that is part of the app jar (that links to webapp.war). I wanna skip this whole configuration each time I change a cloud platform. So my 2 questions were : Is it possible to have a scenario under wildfly where the conf is – Ced Jun 23 '16 at 00:14
  • Where the conf is part of my project and not the server. And the second question was : If I can't do that with wildfly, then I can do it with undertow embedded API. However I'm afraid there is a performance cost to that. Is that the case ? – Ced Jun 23 '16 at 00:15
  • 1
    At it's core the Undertow embedded API is just an HTTP server (well that's poorly put, but somewhat true). WildFly is a full EE container that uses Undertow. You can't use the Undertow API to configure WildFly. Have a look at WildFly Swarm. That really seems like what you're after. All configuration is done in code via WildFly Swarm API's. – James R. Perkins Jun 24 '16 at 16:30