Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

This is an example of how to connect a Java Spring microservice to a python one through Thrift. Everything is Dockerized.

Notifications You must be signed in to change notification settings

haduart/Thrift-Docker-HelloWorld-with-Java-Spring-and-Python-Server

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Working on localhost

Starting the Python Thrift Server

cd python-server-thrift/
source bin/activate
python PythonServer.py


Starting the Java Thrift Client, that is at the same time a REST Server.
cd java-client-thrift/
mvn clean install
mvn spring-boot:run


Testing it.

curl http://localhost:8080/hello

Java REST server is listening on port 8080, starts a thrift client and connects to the thirft server at port 9090.


Working with Docker-Compose

First Compiling the Java Client

cd java-client-thrift/
mvn clean install

Then using the docker-compose commands.

cd ../

docker-compose up -d
docker-compose ps
docker-compose logs -f

If you want to stop them
docker-compose down
And if you want to delete them completely
docker-compose down --rmi all --volumes


Working with Maven Docker Plugin
cd python-thrift-server/
docker run -p 9090:9090 --name python-thrift-server -d python-thrift-server:latest
cd ../

cd java-client-thrift/
mvn docker:build
docker run -d  -p 8080:8080 --name java-test-client -e PYTHON_THRIFT_PORT=9090 java-test-client:latest

About

This is an example of how to connect a Java Spring microservice to a python one through Thrift. Everything is Dockerized.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.