Integrating SmartFoxServer 2X into existing Spring + Hibernate + JPA project

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
YoungDeveloper
Posts: 48
Joined: 02 Mar 2014, 21:38
Location: Latvia

Integrating SmartFoxServer 2X into existing Spring + Hibernate + JPA project

Postby YoungDeveloper » 04 Apr 2022, 11:52

Hi, we have existing java project Spring + Hibernate + JPA hosted on digital ocean with postgres db, we need to integrate SmartFoxServer 2X server side extension support.

Right now we purchased overcast and have it working with some public variables sync to test things out, but its time for server side logic and extensions.
What is the best to do start on this migration in 2022 ?
Thanks
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Integrating SmartFoxServer 2X into existing Spring + Hibernate + JPA project

Postby Lapo » 05 Apr 2022, 12:32

Hi,
the title says "integration" but the message says "migration"... I am not sure what you're trying to do, exactly.

SFS2X Extensions are essentially normal Java classes that extend a base object. So if you need to add some Hibernate + JPA code in an SFS2X Extension you just need to add those dependencies to your Extension project and start coding.

In the deployment phase you will need to move those dependencies to the SFS2X/extensions/__lib__/ folder which is the default place where all your dependency jars should be placed.

As regards Spring... personally I am not a fan :D If you need to keep it, I have no specific suggestions unfortunately. It's a massive, complex framework that I wouldn't touch with long stick unless, maybe, for a large enterprise-scale project. :wink:

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
YoungDeveloper
Posts: 48
Joined: 02 Mar 2014, 21:38
Location: Latvia

Re: Integrating SmartFoxServer 2X into existing Spring + Hibernate + JPA project

Postby YoungDeveloper » 05 Apr 2022, 12:52

We need to integrate and process is a migration)

Regarding spring: We have functionalities which can be triggered from website similar as from app, so keeping unified endpoints helps, maybe you have suggestions ?
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Integrating SmartFoxServer 2X into existing Spring + Hibernate + JPA project

Postby Lapo » 05 Apr 2022, 14:32

Hi,
I don't have much more to add to my previous answer, but to recap:

As regards JPA + Hibernate, you just need to bring the relative jar libraries in your Extension project, and deploy them in the path I mentioned.

As regards PostgreSQL I would expect the relative JDBC drivers to be already present in your current application and configured via the JPA/Hibernate config, so it should be migrated with the rest of the libraries.

Some of these libraries such as Hibernate use config files that are loaded from the current file path. When using SFS2X keep in mind that the "current path" is the SFS2X/ folder.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 114 guests