0
votes

I am trying to configure the Java Mail Sessions Resource in the Netty server Play config and loop up this resource using JNDI in my application. I couldnt find this in Play framework documentation nor any articles for this set up. I also looked up on the Play code, but no luck.

https://github.com/playframework/playframework/blob/master/framework/src/play-netty-server/src/main/resources/reference.conf

https://github.com/playframework/playframework/blob/master/framework/src/play-netty-server/src/main/scala/play/core/server/NettyServer.scala

Play Version: 2.4.6

HTTPmail.setMailSessionFromJNDI("java:comp/env/mail/myemailserver");

Could anyone guide me to some articles or share the knowledge?

We are deploying our play applications in tomcat environment and the resources are expected to looked up from server configurations through JNDI. As a first step, I am trying to make the application work in Netty during development and move to TOMCAT later. thank you for the guidence.

1

1 Answers

0
votes

If you want to use the sessions in the same way as in Tomcat's HttpSession, you should forget it immediately. Play Framework can store only String instances. In additionally, session data can take only 4kb of data because data is stored in the cookie called PLAY_SESSION. This kind of constraint a little bit logical. If enhances stateless character of the application, so also its scalability. For more complex use of Play sessions (shopping carts), you should think about alternatives as NoSQL, file system or database.

Read this