0

Let's say that I would like to analyse some tweets (for example, count the number of tweets that were written in the last 24 hours) using tweepy library and use the outcome in my Java app. I'd like to write a Python microservice that conducts the analysis and then print the result of the analysis from the Java code (simply System.out.print).

I'd like to ask you for some books/articles/videos/blog posts recommendations that teach how can it possibly be done. I don't know whether a Python service should be running somewhere on my computer or can it be called from Git? How to integrate it with Java? How to call it from Java environment etc.

I've seen these topics: Java Python Integration and Python web service for a java application?, but neither first nor second address the issues I have. I'd like a step-by-step walkthrough of an integration between a Python microservices and a Java app.

SkogensKonung
  • 601
  • 1
  • 9
  • 22

1 Answers1

2

I think that you will need two services, in order to achieve what you want using a micro-service architecture , the first one is written in Python ( to analyse the tweets ) and the other one written in java to print the result . That means, they are two separate application, so you need to make them communicate with each others. To do that there are many standards/protocols ( REST,SOAP,MQ,...) but the easiest one will be to use a REST API . So for example you can build your python app as a web application that exposes the operations of tweets analysis on different endpoints on a port in your system . then the java application will request the exposed python service via a web client and display the result . some links to help you :

aouakki
  • 310
  • 5
  • 16