|
| 1 | +# Project Template for Python.Java Remote Services |
| 2 | + |
| 3 | +There is a new project template an simple 'hello' example using the [ECF Python.Java Distribution Provider](https://github.com/ECF/Py4j-RemoteServicesProvider) for |
| 4 | +microservice<->microservice interaction between a Java/OSGi process, and a Python process. |
| 5 | + |
| 6 | +This enables a standard way (via [RSA](https://docs.osgi.org/specification/osgi.cmpn/7.0.0/service.remoteserviceadmin.html)) to discover and use OSGi Remote Services |
| 7 | +between the OSGi service registry and [iPOPO](https://ipopo.readthedocs.io/en/3.1.0/), an OSGi-like service registry, component |
| 8 | +model, and dynamic injection framework for Python 3.9+. See also [here](https://ipopo.readthedocs.io/en/3.1.0/tutorials/index.html) for iPOPO tutorials for the |
| 9 | +Python side-RSA impl, |
| 10 | +providing other kinds of service/endpoint discovery (e.g. etcd3) and distribution providers currently available, along with a full API for adding |
| 11 | +custom discovery and/or distribution providers in Python, that can use proprietary and/or open communications protocols. |
| 12 | + |
| 13 | +Below is a short description of how to access and use the project template example from within the ECF Bndtools Workspace Template. |
| 14 | + |
| 15 | +With Bndtoools 7.1+, create a new Eclipse workspace and choose New->Bnd OSGi Workspace. |
| 16 | + |
| 17 | +1. Create a new Bndtools Workspace using the [ECF Bndtools Workspace Template](https://github.com/ECF/bndtools.workspace) |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +2. Create a new Bnd OSGi project |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | +3. Open the projectName.hellopython.javahost.bndrun file in the project directory |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | +4. Choose 'Resolve' and then 'Update' |
| 30 | + |
| 31 | +5. Select Debug OSGi to start the example application (Java) |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | +Running Python Example Program |
| 36 | + |
| 37 | +1. Install [iPOPO v 3.1.0](https://ipopo.readthedocs.io) in your Python (3.9 or greater) local environment |
| 38 | + |
| 39 | +2. In a command shell or IDE, navigate to the project directory and run the run_python_example.py script |
| 40 | + |
| 41 | +``` |
| 42 | +python run_python_example.py |
| 43 | +``` |
| 44 | +The examples will output progress to their respective consoles as the remote services are made exported, |
| 45 | +discovered, and imported by the java process or the python process. |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | +Most of the code that produces output is available in the example project. For java: src/main/java/.../hello/*.java |
| 50 | +and python: python-src/samples/rsa |
0 commit comments