Skip to content

Commit 3a69c34

Browse files
authored
Create 2025-04-30-python-java-bndtools-template
Initial checkin
1 parent 9217228 commit 3a69c34

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+
![bndtoolsnewwkspace](https://github.com/user-attachments/assets/95ec5792-6bc2-4c88-990d-4e8d3350627e)
20+
21+
2. Create a new Bnd OSGi project
22+
23+
![bndtoolsnewproject](https://github.com/user-attachments/assets/fa2641e6-a074-4796-b761-f79999b9ba06)
24+
25+
3. Open the projectName.hellopython.javahost.bndrun file in the project directory
26+
27+
![bndtoolsbndrun](https://github.com/user-attachments/assets/9bf8a380-9ee7-4e48-ac49-1627cf3ace75)
28+
29+
4. Choose 'Resolve' and then 'Update'
30+
31+
5. Select Debug OSGi to start the example application (Java)
32+
33+
![bndtoolsdebug](https://github.com/user-attachments/assets/9fa2536f-9748-4f5f-94bc-b78374f436a8)
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+
![bndtoolspython](https://github.com/user-attachments/assets/d5bbd4e4-d57c-412a-a198-fe16ed76a95d)
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

Comments
 (0)