0

Hello all,

I am trying to figure out how to move my current system architecture based on modules (war´s) running in Wildfly. Nowadays all infra resources are placed in JNDI tree, such as Datasources, JMS, etc... The framework for my projects is Spring 4 and family, which allows me to lookup those resources and other things.

My goal is to create a micro-service architecture using Spring-Boot and Spring Cloud Netflix, where each one of those WAR´s would be a new independent application integrated by Bus service.

But my doubt is, how to share those Jndi Datasources with all single Spring Boot applications, keeping in mind it´s not nice to have to setup user/password for each application / datasource in each application.properties.

Is there any way to have a master Spring Boot managing all sub-projects, because the great advantage is to have a application running in one port and other one running in another one, so if any problem happens for example Wildfly wouldn't stop all of them, for what now happens in my current architecture.

(Spring Boot) + (Spring Cloud) + (single jndi tree for all projects) + (independent modules between themselves)

Let me know your thoughts!

Thanks...

  • The idea behind spring boot was based in the microservices (in my opinion) with the cloud components you have differences way to integrate your services using fat jars – Tiarê Balbi May 02 '15 at 18:09

1 Answers1

3

Spring Cloud has a module called Spring Cloud Config, which is for exactly that purpose. The configuration server allows you to centrally define your configuration, and each micro service automatically fetches this configuration (and refreshes it, if necessary). Regarding the single JNDI tree, i think, this contradicts the architecture of micro services a bit. Since every micro service has its own database, you only would configure one datasource per micro service, so configuring it in the application.properties or with the config server hasn't that much overhead.

dunni
  • 43,386
  • 10
  • 104
  • 99
  • Talking about micro-services model, you mean when I have a database should I centralize all services into one Spring boot application? In my opinion I could have any Spring Boot applications meaning a functionality, so it could point to the same database. In this case many projects could share this same data source, isn't right? – Ofbizbrazil May 02 '15 at 19:28
  • If you have one database which you want to use for all microservices, you have to ask yourself if each of the services really provides one single functionality and if separating your application into microservices really provides you with advantages like scalability and availability. But this is a difficult topic and not easily discussed on a platform like this. – dunni May 02 '15 at 21:31
  • Let's suppose I really want to have many Spring Boot applications pointing to the same database, how could I solve it? I mean it, because each one of those applications will have a different http port what is different when I deploy in Wildfly getting the same http port. Decentralize war's from Wildfly to Spring Boot application, would give me a different paradigm to manage and keep the server safe, but on the other hand it makes more difficult to manage infra resources. That's the point I mean, how to keep ease the management side. – Ofbizbrazil May 02 '15 at 21:58
  • In that case use the Spring Cloud Config server. There you can manage your configuration in a central place. It's based on Git repositories, so your configuration is versioned and due to the distributed nature of Git repositories it has also a local fallback if the config server is not available. – dunni May 03 '15 at 04:31