Giter Site home page Giter Site logo

asc-lab / micronaut-microservices-poc Goto Github PK

View Code? Open in Web Editor NEW
487.0 54.0 171.0 17.32 MB

Very simplified insurance sales system made in a microservices architecture using Micronaut

Home Page: https://altkomsoftware.pl/en/blog/microservices-micronaut/

License: Apache License 2.0

Dockerfile 0.69% Java 72.22% JavaScript 2.05% HTML 1.35% Vue 12.48% Shell 1.68% Batchfile 1.38% Kotlin 1.86% TypeScript 6.02% CSS 0.29%
micronaut microservices microservices-architecture insurance consul kafka zipkin mongodb postgresql h2-database

micronaut-microservices-poc's People

Contributors

arekros avatar azure-pipelines[bot] avatar grimmjo avatar khelman avatar kingzevin avatar rkusmierek avatar sdelamo avatar witek1902 avatar wojteksuwala avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

micronaut-microservices-poc's Issues

Script to build all services

For demo purposes, we need a script to build all the services.
This can be in form of parent pom.xml or regular script that uses maven to build each service.

Elasticsearch container doesn't start on kubernetes

Elasticsearch version:
docker.elastic.co/elasticsearch/elasticsearch:6.4.2

logs:

[2018-10-18T09:05:09,530][INFO ][o.e.n.Node               ] [BXSDDvd] starting ...
[2018-10-18T09:05:09,762][INFO ][o.e.t.TransportService   ] [BXSDDvd] publish_address {172.17.0.6:9300}, bound_addresses {0.0.0.0:9300}
[2018-10-18T09:05:09,806][INFO ][o.e.b.BootstrapChecks    ] [BXSDDvd] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: memory locking requested for elasticsearch process but memory is not locked
[2018-10-18T09:05:09,850][INFO ][o.e.n.Node               ] [BXSDDvd] stopping ...
[2018-10-18T09:05:09,914][INFO ][o.e.n.Node               ] [BXSDDvd] stopped
[2018-10-18T09:05:09,921][INFO ][o.e.n.Node               ] [BXSDDvd] closing ...
[2018-10-18T09:05:09,971][INFO ][o.e.n.Node               ] [BXSDDvd] closed
[2018-10-18T09:05:09,976][INFO ][o.e.x.m.j.p.NativeController] Native controller process has stopped - no new native processes can be started

Docker network_mode: host supports only Linux

I am a Windows user.

When running docker-compose i can not access kafka manager via localhost:9000.

Here i found this info:

The host networking driver only works on Linux hosts, and is not supported on Docker Desktop for Mac, Docker Desktop for Windows, or Docker EE for Windows Server.

Is there an option to change docker files so they won't use network_mode: host ?

Also i found out - that i need to have Linux ending file (LF) instead of Windows default (CRLF) to keep container mn-web-vue running.

Elasticsearch container doesn't start on Kubernetes hosted in the cloud

Elasticsearch version:
docker.elastic.co/elasticsearch/elasticsearch:6.4.2

logs:

[2018-11-06T17:01:53,087][INFO ][o.e.n.Node               ] [yHdqr9S] starting ...
[2018-11-06T17:01:53,475][INFO ][o.e.t.TransportService   ] [yHdqr9S] publish_address {10.48.4.11:9300}, bound_addresses {[::]:9300}
[2018-11-06T17:01:53,510][INFO ][o.e.b.BootstrapChecks    ] [yHdqr9S] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2018-11-06T17:01:53,556][INFO ][o.e.n.Node               ] [yHdqr9S] stopping ...
[2018-11-06T17:01:53,580][INFO ][o.e.n.Node               ] [yHdqr9S] stopped
[2018-11-06T17:01:53,581][INFO ][o.e.n.Node               ] [yHdqr9S] closing ...
[2018-11-06T17:01:53,605][INFO ][o.e.n.Node               ] [yHdqr9S] closed
[2018-11-06T17:01:53,609][INFO ][o.e.x.m.j.p.NativeController] Native controller process has stopped - no new native processes can be started

[documents-service] org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for current thread.

In documents-service, when a policy is paid, an error is raised: org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for current thread. I've added the policy template in JSReport and committed.

14:28:54.569 [pool-2-thread-1] ERROR i.m.c.k.e.KafkaListenerExceptionHandler - Error processing record [Optional[ConsumerRecord(topic = policy-registered, partition = 0, leaderEpoch = null, offset = 3, CreateTime = 1598884133749, serialized key size = 36, serialized value size = 159, headers = RecordHeaders(headers = [], isReadOnly = false), key = [B@7dbe50be, value = pl.altkom.asc.lab.micronaut.poc.policy.service.api.v1.events.PolicyRegisteredEvent@7c3b26a3)]] for Kafka consumer [pl.altkom.asc.lab.micronaut.poc.documents.domain.PolicyRegisteredListener@3a66e52c] produced error: Could not obtain transaction-synchronized Session for current thread
org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for current thread
	at io.micronaut.transaction.hibernate5.MicronautSessionContext.currentSession(MicronautSessionContext.java:100)
	at org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:475)
	at io.micronaut.configuration.hibernate.jpa.TransactionalSessionInterceptor.intercept(TransactionalSessionInterceptor.java:56)
	at io.micronaut.aop.chain.MethodInterceptorChain.proceed(MethodInterceptorChain.java:69)
	at io.micronaut.configuration.hibernate.jpa.TransactionalSession$Intercepted.persist(Unknown Source)
	at pl.altkom.asc.lab.micronaut.poc.documents.infrastructure.adapters.db.PolicyDocumentDb.add(PolicyDocumentDb.kt:20)
	at pl.altkom.asc.lab.micronaut.poc.documents.domain.PolicyRegisteredListener.onPolicyRegistered(PolicyRegisteredListener.kt:24)
	at pl.altkom.asc.lab.micronaut.poc.documents.domain.$PolicyRegisteredListenerDefinition$$exec1.invokeInternal(Unknown Source)
	at io.micronaut.context.AbstractExecutableMethod.invoke(AbstractExecutableMethod.java:146)
	at io.micronaut.core.bind.DefaultExecutableBinder$1.invoke(DefaultExecutableBinder.java:109)
	at io.micronaut.configuration.kafka.processor.KafkaConsumerProcessor.lambda$process$7(KafkaConsumerProcessor.java:498)
	at io.micronaut.scheduling.instrument.InvocationInstrumenterWrappedRunnable.run(InvocationInstrumenterWrappedRunnable.java:47)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

[Automated deployment] local machine problem with docker build step

I've found out that there is issue with command $ sh docker-run.sh

Building mn-documents-service
Step 1/4 : FROM openjdk:8u171-alpine3.7
8u171-alpine3.7: Pulling from library/openjdk
911c6d0c7995: Pull complete
4001add52a90: Pull complete
874028933da5: Pull complete
Digest: sha256:12e19d0dffa75ded3ab909e8c1966682b097f155ca0c2c88577445c64d6776d5
Status: Downloaded newer image for openjdk:8u171-alpine3.7
 ---> 1caad94162ef
Step 2/4 : RUN apk --no-cache add curl
 ---> Running in 7b456af061f8
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
(1/3) Installing libssh2 (1.8.2-r0)
(2/3) Installing libcurl (7.61.1-r2)
(3/3) Installing curl (7.61.1-r2)
Executing busybox-1.27.2-r11.trigger
OK: 100 MiB in 56 packages
Removing intermediate container 7b456af061f8
 ---> 8c3c977f7245
Step 3/4 : COPY target/documents-service*.jar documents-service.jar
ERROR: Service 'mn-documents-service' failed to build: COPY failed: no source files were specified

Is there any clue that can be helpful to fix it?

Get rid of Lombok dependency

It is more like question than issue. I would prefer the project without dependency on Lombok since it forces me to install additional IDE plugins.

Are you interested in PR that replaces Lombok with regular Java code?

Error run docker-run.sh. Cannot start service mn-web-vue

Hi, I have a problem when i launch the docker-run:

ERROR: for mn-web-vue Cannot start service mn-web-vue: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: "/entrypoint.sh": stat /entrypoint.sh: no such file or directory": unknown

ERROR: for mn-web-vue Cannot start service mn-web-vue: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: "/entrypoint.sh": stat /entrypoint.sh: no such file or directory": unknown
ERROR: Encountered errors while bringing up the project.

ANy solutions for this problem? I have performed all the steps described

Thaks

Unable to setup Kafka Cluster

I had no issues building and running the program until it was time to add a Kafka cluster. When running the kafka-create-cluster.sh file I received the following message:

  • Trying 127.0.0.1...
  • TCP_NODELAY set
  • Connection failed
  • connect to 127.0.0.1 port 29092 failed: Connection refused
  • Trying ::1...
  • TCP_NODELAY set
  • Connection failed
  • connect to ::1 port 29092 failed: Connection refused
  • Failed to connect to localhost port 29092: Connection refused
  • Closing connection 0

Any suggestions? Thanks.

Contracts

Decouple services by removing shared libraries and applying API contracts.

Docker-compose does not expose 9000, 9092, 2181 ports

As documentation states now:

https://github.com/asc-lab/micronaut-microservices-poc#automated-deployment

Afterwards you need to add kafka cluster - either via web UI (Kafka Manager -> Cluster -> Add Cluster) or using provided script:

kafka-create-cluster.sh

To be able to do that you must have connection to kafka manager via localhost:9000.

If you execute now docker-compose up you see that this port is not exposed:

2

To expose this port remove:

network_mode: host

from kafka_manager container definition.

After this change you see that port 9000 is exposed:

1

I will make pull request regarding this issue. This also need to be fix for other containers like:
kafkaserver.

Still there is issue after visiting localhost:9200 and executing script kafka-create-cluster.sh

chrome_2019-07-17_16-13-22

I am a Windows user.

Add CI/CD

Add config for CI/CD (for example Azure DevOps).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.