Похожие чаты

I have multiple microservices that communicate with each other. They

have different ports and other dependencies. Running an instance of each of them on a local machine for development is heavy on system resources. My understanding is that each of these springboot apps will have a seperate JVM instance.

Is there any way to run them as a single app so that all of them will run on a single JVM instance ?

9 ответов

17 просмотров

Isn't that just a monolith with extra steps?

Dinesh- Автор вопроса
MUTHU・KUMAR 「メーカー」 🔺
Isn't that just a monolith with extra steps?

In a way! This is not intended for deployment, just for reducing system resource usage in local environment...

I don't know Java, but in theory it should just be enough to import the root of each service from another file?

Dinesh- Автор вопроса
MUTHU・KUMAR 「メーカー」 🔺
I don't know Java, but in theory it should just be...

One similar solution I tried was to create a new application and add each of the seperate services as dependencies. Added component scan paths and exposed multiple ports on the server as per each services requirement. The services could communicate with each other as expected but the issue is, 1, same endpoint paths exist in these services 2, any of those endpoints can be accessed from any of those ports. 3, beans with same names exists across these services - renaming them is not ideal. So that solution was not adoptable in my case.

Dinesh
One similar solution I tried was to create a new a...

The services don't take independent port numbers? Is this a problem of port number for each service being assigned by the same env var, for example?

Dinesh- Автор вопроса
MUTHU・KUMAR 「メーカー」 🔺
The services don't take independent port numbers? ...

I don't think so.. simply what I did was just add all the endpoints from the services into a new app that has multiple ports exposed...they are on the single embedded server. Not the right solution, I realised 😅

This is possible as long as all your microservices are OK to run on the same *version* of java/jvm. You'll need to run them somehow in individual class loaders. Suggested article at a galnce seems to suggest exactly that. But I would recommend you entirely different approach - don't do this. You'll waste tons of time on setting up the system that has never been intended to be set up this way. You'll have to write all that glue code and maintain it. Depending on whether your services are in a single repo, or they are each in a separate repo, this glue code can be quite complex. Also depending on the repo structure, it may be cumbersome to pull latest upstream. Also you may face bugs/limitations that are not obvious (e.g. some library may use native code which does not support to be shared between multiple class loaders). Just answer yourself - why do you need to run all the services at once on your machine? I never ever had a single reason to do that in my entire experience. I'm 99.99% sure you have dev environment, right? Just run one or two services that you need from you local, and the rest - in dev environment. And connect your local running services to those remotely running services in dev env. Even if you're developing some feature that affects many services, you still are not doing it in all the services at once. You'll do it one after another. So services that are done - just deploy them in dev off you feature branch.

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта