How to configure payara micro the right way?

Hi,
we plan to deploy our Jakarta EE application on payara micro using Docker. But this seems not to be so easy as it sounds?
In our application we need

  • a JDBC Pool configuration,
  • a security realm configuration (database based) ,
  • and a mail configuration (connection to my smarthost).

In the past we used Payara Full version where we have a customized domain.xml file with all configuration details used to build a Docker image (domain.xml + jakarta war file.)

But in Payara Micro this way seems not to be possible??

I found this blogpost about how to setup a JDBC Pool:

But putting the JDBC Pool configuration into the WEB-INF folder is no option for us, because our open source project is Database vendor independent and we can not build a war file with hard coded database connection data. The same situation we have with the security realm, which need to be customized project specific. Sometimes it is a database realm and in other cases it is a LDAP realm. We don’t want to compile the application with this details.

I wonder if there is at least a possible solution using payara micro or should we run our application on Payara full?

Thanks for your comments and help.

===
Ralph

Hi,

AFAIK, The Payara Micro provides at least two ways to achieve this.

Firstly, the Payara Micro Command Line Options provides the option --domainconfig <file-path> which we are able to point to our customized domain.xml.

Secondly, it provides the --prebootcommandfile <file-path> and --postbootcommandfile <file-path> which executes in the same manner of the asadmin command of the Payara Full as stating at Running asadmin commands using Preboot and Postboot Scripts, together with supporting the variable, e.g. defined at system properties, OS environment variable and so on as Types of variable references and Using variable references. (We may refer to my reply in this forum at Micro Payara configuration in effect for reference.)

Furthermore, if we are not sure about the proper commands to put to our preboot and postboot scripts, The Payara full also provides the Asadmin Recorder to record the actions we take in the admin console as asadmin commands to the log file so that we are able to copy those customizing acitivities within the admin console to the preboot and/or postboot easily.

Please note that most of asadmin command are supported by Payara Micro, but not all. We should consult the documentation case by case.

Thanks a lot for your answer! The option --domainconfig is what I was missing.
Now it’s more clear to me.

1 Like