scalar-labs / btm

JTA Transaction Manager
Apache License 2.0
424 stars 152 forks source link

Need an empty properties file to reference in my Jetty module #72

Closed a1730 closed 4 years ago

a1730 commented 7 years ago

I would appreciate if someone in the core team can create an empty btm-config.properties file associated with the btm project for use in creating a Jetty 9 modules file. I had to reach into the zyeeda/docker github project to get a blank properties file but it would be nice if I don;t have to leave the BTM project for this.

#
# Jetty BTM Module
#   Bitronix Transaction Manager
#
[name]
btm

[depend]
jndi
resources

[lib]
lib/btm/*.jar

[xml]
etc/jetty-btm.xml

[files]
etc/
resources/
work/
ext/btm/
maven://javax.transaction/jta/1.1|lib/btm/jta-1.5.jar
maven://org.codehaus.btm/btm/2.1.4|lib/btm/btm-2.1.4.jar
maven://org.javassist/javassist/3.21.0-GA|lib/btm/javassist-3.21.0-GA.jar
https://raw.githubusercontent.com/zyeeda/docker/master/java/jetty9/jetty_base/resources/bitronix-default-config.properties|resources/btm-config.properties

Thank you.

lorban commented 7 years ago

I'm not familiar with the Jetty 9 modules and I'm not sure what the btm-config.properties file has to do with that. Could you be more explicit?

a1730 commented 7 years ago

Starting with Jetty 9.1, a new Module system was introduced, replacing the previous start.config + OPTIONS techniques from past Jetty Distributions. The module system allows the user to add Bitronix to a Jetty instance. When you want enable a module [http://www.eclipse.org/jetty/documentation/9.3.13.v20161014/startup-modules.html], you can use the --module= syntax on the command line to enable that module and all of its dependent modules.

All one need do to add Bitronix to jetty with the module file provided above is: java -jar /opt/jetty-distribution/start.jar --add-to-startd=btm and Bitronix will be added to ${jetty.base}, configured and ready to run.

Going further, one can configure bitronix with the resource loader. I am using this facility to provide default resources for a production environment so the operator does not need to modify Jetty XML to create the JNDI bindings. Hence the need for the properties file.

I used setResourceConfigurationFilename() in my jetty-btm.xml file, leveraging Jetty IOC, to point to an empty file in development where developer bind datasource objects to jetty JNDI but not for production. In production, we populate the resource properties file and leverage BTM read-only JNDI for the datasources.

Does this make sense?

a1730 commented 7 years ago

Please close this request. I'm serving the file from my GitHub account. Thank you.