Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8782245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:31:19+00:00 2026-06-13T20:31:19+00:00

I am starting a project which is supposed to provide both: simple http API

  • 0

I am starting a project which is supposed to provide both:

  • simple http API and
  • some other functionality (including some low-level networking).

This is why I would like to integrate the “other functionality” with a (new) Play framework project and make use of it’s on-the fly compilation and other benefits. The majority of the application (both in terms of business logic and server load) will be in the non-web part of the project.

So my question is: how do I go about packing both those modules into one Scala application?

The best approach I think I found is treating the non-web part as a plugin for the Play project. I am not sure however if this is the right approach, considering the majority of the application might end up in such a “plugin”.

I thought about deploying the two parts as separate applications, but I doubt it would work for me: I would like the applications to share (among others) cache, config and db connections, and I shouldn’t really separate them.

I’m not yet experienced with either Scala or Play, so I will very much appreciate your input.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T20:31:20+00:00Added an answer on June 13, 2026 at 8:31 pm

    I would recommend using Akka actor systems to integrate your existing business logic and networking services. You can easily add multiple Akka actor systems and integrate them into a complete system in your Play application. Play also comes with an internal actor system that you can take advantage of.

    So, you can wrap your existing logic into an actor system in itself or you can build small actor systems that takes care of the integration with the existing systems and start up those connectors as actor systems when the Play application loads.

    Here is an example how you can load the internal actor system when the Play application loads.

    object Global extends GlobalSettings {
    
      override def onStart(app: Application) {
        Logger.info("Application starting...")
        lazy val enabled = Play.configuration.getString("external-service").filter(_ == "enabled").isDefined
    
        // Start External service
        enabled match {
          case true => {
            Logger.info("External service is enabled.")
            Akka.system.actorOf(Props[ExternalServiceClient], name = "serviceClient")
          }
          case false => {
            Logger.info("External service is disabled.")
          }
        }
      }
    
      override def onStop(app: Application) {
        Logger.info("Application shutdown...")
      }
    }
    

    You can also load new actor systems within the application if needed, doing something like this.

      import akka.actor.ActorSystem
    
      val eventSystem = ActorSystem("events")
    
      // Start a service using the ActorSystem
      val eventService = EventService(eventSystem)
    
      // Create an Actor in the ActorSystem
      val eventActor = eventSystem.actorOf(Props[EventActor], name = "eventactor")
    

    You can read more about Play Akka integration here. Play also has built in functionality where you can take advantage of the built in actor system with features such as the ScalaAsync etc. So if your external services are mainly HTTP based services that approach might work best for you. If you build actor systems for your external services you can access then as remote actors as explained here Akka Remoting

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am starting a project which has several applications. These applications share some common
All, I'm starting a new ASP.NET MVC project which requires some content management capabilities.
I am currently starting a project which I would like to develop both a
I'm starting a new project which in simple terms will have a UI layer
I will be starting a project which requires communication between distributed nodes(the project is
I am starting with a test automation project which is based on keyword driven
I am shortly starting a project, which requires messages to be held in a
I'm starting a new project, for this project, I need a great IDE, which
Starting with a blank project, when I load a SWF which has a dependence
Possible Duplicate: Storing third-party libraries in source control I'm currently starting a project which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.