New Project Template for Python.Java Remote Services
There is a new project template an simple ‘hello’ example using the ECF Python.Java Distribution Provider for microservice<->microservice interaction between a Java/OSGi process, and a Python process.
OSGi Remote Service Admin enables a standard way (via RSA) to discover and use OSGi Remote Services between the OSGi service registry and iPOPO, an OSGi-like service registry, component model, and dynamic injection framework for Python 3.9+. See also here for iPOPO tutorials for the Python side-RSA impl, providing other kinds of service/endpoint discovery (e.g. etcd3) and distribution providers currently available, along with a full API for adding custom discovery and/or distribution providers in Python, that can use proprietary and/or open communications protocols.
Below is a short description of how to access and use the project template example from within the ECF Bndtools Workspace Template.
With Bndtoools 7.1+, create a new Eclipse workspace and choose New->Bnd OSGi Workspace.
- Create a new Bndtools Workspace using the ECF Bndtools Workspace Template
- Create a new Bnd OSGi project
- Open the projectName.hellopython.javahost.bndrun file in the project directory
-
Choose ‘Resolve’ and then ‘Update’
-
Select Debug OSGi to start the example application (Java)
Running Python Example Program
-
Install iPOPO v 3.1.0 in your Python (3.9 or greater) local environment
-
In a command shell or IDE, navigate to the project directory and run the run_python_example.py script
python run_python_example.py
The examples will output progress to their respective consoles as the remote services are made exported, discovered, and imported by the java process or the python process.
Most of the code that produces output is available inside the example project. For java: src/main/java/…/hello/*.java and for the python code: python-src/samples/rsa
Next