Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to structure the application? #239

Open
romulloal opened this issue Sep 16, 2022 · 1 comment
Open

How to structure the application? #239

romulloal opened this issue Sep 16, 2022 · 1 comment

Comments

@romulloal
Copy link

Hi people, I'm learning ActiveJ.

I code a simple http service using MultithreadedHttpServerLauncher, like the http docs. It just query a h2 database and sends a json response. Today I have a simple class that extends MultithreadedHttpServerLauncher and overrides servlet() method. In servlet() I use BasicAuth and RoutingServlet. There is a hikaricp pool for the database access.

Now I want to code two more services in that app. Each service will open a https connection to another host:port, gets the content, process and return a json.

I read tutorials, docs and examples but I could not understand how to structure that app with Launchers, Modules, Services...

How could I struture that app? (like, a HttpLauncher, a Service1Module, a Service2Module) And how to bind these classes?
How should I call the services in a RoutingServlet? I need to configure and use a AsyncHttpClient to connect to host:port, that's ok, but I don't know how the client can be injected?

Thanks in advance.

@romulloal romulloal changed the title (Question) How to structure the application? How to structure the application? Sep 19, 2022
@romulloal
Copy link
Author

Please ignore, as I'm going to read Discussions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant