Ask questions and see you at June, 5th at 6.PM. CET: http://www.ustream.tv/channel/adambien
-
-
Save AdamBien/b1a66dafdae21c0c40d647f05f44e57c to your computer and use it in GitHub Desktop.
Hi Adam,
what about testing of @asynchronous methods? Are there any useful libraries for that? Thanks
Marco
Not a question but maybe an answer to @mehdithe as I normally use Wildfly in production.
- make sure you have add the driver library as a module to your wildfly.
- Then you can define something like this in your standalone.xml
<datasource jndi-name="java:/jdbc/inzo24-is24-ds" pool-name="inzo24-datasource" enabled="true" statistics-enabled="true"> <connection-url>YOUR_JDBC_URL</connection-url> <driver>mysql</driver> <security> <user-name>YOUR_USERNAME</user-name> <password>YOUR_PASSWORD</password> </security> <validation> <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/> <background-validation>true</background-validation> <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/> </validation> </datasource>
for this I had for the driver definition
<driver name="mysql" module="com.mysql"> <driver-class>com.mysql.jdbc.Driver</driver-class> </driver>
In your persistence.xml
<persistence-unit name="finance-prod" transaction-type="JTA"> <jta-data-source>java:/jdbc/inzo24-is24-ds</jta-data-source> <class>com.dwitech.eap.inzo24.finance.entity.City</class> <class>com.dwitech.eap.inzo24.finance.entity.Region</class> <class>com.dwitech.eap.inzo24.finance.entity.ZipcodeTransferTax</class> <properties> </properties> </persistence-unit>
Then you can inject the entity manager with@PersistenceContext(unitName = "finance-prod") public EntityManager em;
Now my question :)
Hi Adam, I wanted to know what is your take on using technologies like Wildfly Swarm or SpringBoot. I kind of love the way one can make a runnable Jar that contains the whole service and a container but I really dislike the way one ends up. with a bloated file: I wanted to test how they work and with a 750 KB war that I had for my service, I ended up with a 50+MB file. My actual VPS doesn't support Docker so I can't use containers as I would like so I end up working with "normal" application servers deployed on the system, and I was looking on trying to leverage the use of Swarm or Boot but after seeing the size of the runnable file I'm not really bought into it.
Thanks,
Daniel
Hi Adam,
what are your experiences with the Java EE Batch API (JSR 352), especially JBeret (the JSR 352 implementation in JBoss EAP/Wildfly) concerning
- Monitoring
- Clustering
- Scheduling (EJB timer or
ScheduledExecutorService
?)? - Resilience (what happens if a job connects to a e.g. mail server but for some reason the job runs forever because a timeout is not working?)
A typical job in our application is: (a) reading a file from imap/folder/ftp/database/… (b) doing some processing like validation, transformation, … (c) writing a file to smtp/folder/ftp/database….
Are there any established alternatives to JSR 352? When would you recommend to build a own job framework?
Hi Adam,
Is there a way tu use eclipselink @Multitenant
in CMT (container managed transactions)?
I use JPA (eclipselink implementation) in Payara and in my webapp I need tu use multitenant. What I see is that there are nothing standard in JPA but eclipseLink have @Multitenant
. My problem is that for what i see you can only use @Multitenant
in BMT (bean managed transaction) thats mean I can not inject the entityManager (
@PersistenceContext(unitName = "myPU") private EntityManager em;
)
and set the tenant dynamically.
what are your strategy tu develop multitenant app?
oh and for @mehdithe Antnios´s blog had a good entry about JWT and jax-rs:
[https://antoniogoncalves.org/2016/10/03/securing-jax-rs-endpoints-with-jwt/]
Thanks
Sebastian.
Hi Adam,
I want to create a project with multiple java ee modules packaged in war files connected with each other with rest webservices, these wars are deployed in the same payara appserver and sharing a single database.
Is this kind of architecture suitable to build a project with large amount of data, and is having a unique database can cause performance problems ?
In you opitnion what can be the architecture to build a JEE application with different business modules sharing data between them
thanks
Kiko
Hi Adam, did you have any experience programming an scheduled MDB ?? Could you sho us an example?
Thanks
hello again,
could you please give an example on how to use
jpa
with awildfly server
, and how can we define thepersistance unit
. and inject anentity manager
, (i tried defining a jta-datasource but with no luck i still find errors whenever i try to deploy my application to wildfly) please help .Mehdi .