Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Fineract-CN contains of more than a dozen of micro servicesmicroservices. One doesn't need to run all of them at once - this would be actually quite resource consuming.

These instructions list the bare minimum - getting a single micro service microservice - Identity provisioned and running.

Once you complete these steps you will get a basic understanding of how fineract-cn works and how its micro services microservices are provisioned.

Once you have completed these steps you can move on ant and try to provision more micro servicesmicroservices.


What You will need:

  • Java8
  • , Docker, docker-compose,
  • Postman

P.S: it is possible to go without Docker and Docker compose (you need to install Postgres and Cassandra yourself) but we don't cover it here.

Prepare your environment

Find hosts file (/etc/hosts in Unix/Mac) and add:

127.0.0.1 cassandra
127.0.0.1 activemq
127.0.0.1 eureka
127.0.0.1 postgres
127.0.0.1 provisioner-ms
127.0.0.1 identity-ms

Check out the code

$ mkdir fincn_bare_minimum

$ cd fincn_bare_minimum

$ git clone https://github.com/apache/fineract-cn-identity

$ git clone https://github.com/apache/fineract-cn-provisioner

$ git clone https://github.com/apache/fineract-cn-docker-compose/

Generate RSA keys

$ java -cp fineract-cn-docker-compose/external_tools/lang-0.1.0-BUILD-SNAPSHOT.jar \

   orgorg.apache.fineract.cn.lang.security.RsaKeyPairFactory SPRING > application-common.properties

This generates RSA keys so the micro services microservices trust each other. The contents of application-common.properties will be something like this:

...

Open newly generated application-common.properties and add this to the end of the file:

activemq.brokerUrl=tcp://activemq:61616
cassandra.cl.delete=ONE
cassandra.cl.read=ONE
cassandra.cl.write=ONE
cassandra.cluster.pwd=password
cassandra.cluster.user=cassandra
cassandra.clusterName="datacenter1"
cassandra.contactPoints=cassandra:9042
cassandra.keyspace=seshat
eureka.client.fetchRegistry=true
eureka.client.initialInstanceInfoReplicationIntervalSeconds=10
eureka.client.instanceInfoReplicationIntervalSeconds=1
eureka.client.serviceUrl.defaultZone=http://eureka:8761/eureka
eureka.client.serviceUrl.registerWithEureka=true
eureka.instance.hostname=eureka
eureka.instance.leaseRenewalIntervalInSeconds=10
eureka.registration.enabled=true
feign.hystrix.enabled=false
portfolio.bookLateFeesAndInterestAsUser=service-runner
postgresql.host=postgres
rhythm.beatCheckRate=60000
rhythm.user=imhotep
ribbon.eureka.enabled=true
ribbon.listOfServers=eureka:8761
server.max-http-header-size=24576
spring.cloud.config.enabled=false
spring.cloud.discovery.enabled=true
system.initialclientid=service-runner

Start external tools

$ cd fineract-cn-docker-compose/external_tools

$ docker-compose up -d

$ cd ../..

Now, wait for external tools (Postgre, Cassandra, ActiveMQ and Eureka) to start)

Verify external tools have started

...

Open fineract-cn-provisioner with IntelliJ IDEA and wait for the project to be imported

Open ProvisionerApplication class and  right-click on the class name and choose "Create ProvisionerApplication Run/Debug configuration"

...