Skip to content
This repository has been archived by the owner on May 29, 2023. It is now read-only.

API Gateway use-case #5

Open
FroMage opened this issue Feb 27, 2018 · 7 comments
Open

API Gateway use-case #5

FroMage opened this issue Feb 27, 2018 · 7 comments

Comments

@FroMage
Copy link
Owner

FroMage commented Feb 27, 2018

Figure out if we can support that use-case.

Check:

@fiorenzino
Copy link
Contributor

Starting from the api gateway use-case, i created a big application with microservices with a custom api-gateway+serviceDiscovery in vertx and docker.
I changed something for file upload and for naming conventions for microservices.

If you want, with your help, i can create a little prototype.

@FroMage
Copy link
Owner Author

FroMage commented Mar 22, 2018

What ideas do you have? ATM I'm working on getting async injection working so I can get service registry URLs injected from the vertx-service-discovery module.

@fiorenzino
Copy link
Contributor

My idea is simple:

  • docker-compose with api-gateway, 2 services and mysql. The 2 services use the service discovery to comunicate via rest or via event bus.

docker-compose.yaml

version: "2"
services:
mysql:
image: mysql:5.7
volumes:
- ./mysql/data:/var/lib/mysql
- ./mysql/cnf:/etc/mysql/conf.d
restart: always
expose:
- "3306"
ports:
- "3307:3306"
environment:
MYSQL_ROOT_PASSWORD: xxxx
MYSQL_DATABASE: xxxx
MYSQL_USER: xxxx
MYSQL_PASSWORD: xxxx
command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci, --max-connections=1000, --wait-timeout=300, --interactive-timeout=300]
api-gateway:
image: redpipe/api-gateway
restart: always
mem_limit: 512m
expose:
- "8080"
ports:
- "8080:8080"
environment:
JAVA_OPS: "-Xmx256m"
depends_on:
- mysql
links:
- a-service
- b-service
a-service:
image: redpipe/a-service
restart: always
mem_limit: 512m
environment:
JAVA_OPS: "-Xmx256m"
depends_on:
- mysql
links:
- mysql
expose:
- "8000"
ports:
- "9002:8000"
b-service:
image: redpipe/b-service
restart: always
mem_limit: 512m
environment:
JAVA_OPS: "-Xmx256m"
depends_on:
- mysql
links:
- mysql
expose:
- "8000"
ports:
- "9001:8000"

My redpipe services docker images should have the same java libraries inside, and a single jar with classes of specific service (to slim the docker image creation - no fat jar).
redpipe images should start vertx in cluster mode.
they should share the eventbus and the service discovery.
This night i will try to code a little my idea: i must read more of the Redpipe engine code.
I have questions like: does Redpipe start the vertx verticles in cluster mode? etc etc

my experience with vertx microservices: i used the service discovery between docker machine in cluster (using docker-compose) without kubernetes. for me, it was really simple to deploy without infrastructure like openshift.

@FroMage
Copy link
Owner Author

FroMage commented Mar 22, 2018

We don't start Vert.x in cluster mode, but that should be enabled by config file. Sounds like a good experiment.

@fiorenzino
Copy link
Contributor

this night..i will try!

@fiorenzino
Copy link
Contributor

the use case complete is here:
[email protected]:fiorenzino/redpipe-clustered.git

why don't create a repository for all examples (and to remove from the source of project)?

@rdruss
Copy link

rdruss commented Apr 5, 2018

+1 ... seems reasonable to have examples in a separate repo

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

No branches or pull requests

3 participants