JPype wrapper to use pure Java JMS to send/receive messages to Apache ActiveMQ broker directly in Python. This is not a STOMP but JVM OpenWire used over JNI.
Project description
Jmspy — A Native Python JMS OpenWire Client for ActiveMQ using Jpype
Welcome to Jmspy, a simple tool that enables Python applications to communicate with an Apache ActiveMQ broker using the native JMS OpenWire protocol — not STOMP. Unlike other solutions that rely on STOMP (Simple Text Oriented Messaging Protocol) or Jython (Python-in-Java), this client is built using JPype, which provides a bridge between the JVM and Python via JNI (Java Native Interface). This allows Python to directly interact with JMS-compliant JAR libraries in a proper JVM process — the same way Java applications would. By default, OpenWire listens on port 61616.
Features
- Native JMS (OpenWire) protocol support
- Pure Python interface, no STOMP
- Uses standard Java JARs with JPype
- Send/receive binary files via queues
- Easy integration with Apache ActiveMQ
Installation
You can use the module directly from this repository by downloading it manually or via pip:
pip install jmspy
The required JAR files are already included in the libs/ subfolder for convenience. If you prefer to fetch your own versions of the dependencies, you may use Maven:
mvn clean package
Usage Example
import jmspy
with jmspy.Jmspy("tcp://localhost:61616") as mq:
mq.send_file("myQueue", "message1.txt")
mq.receive_file("myQueue")
You can optionally specify a save directory:
mq.receive_file("myQueue", save_dir="downloads/")
Architecture Notes
- This project uses JPype to launch a local JVM inside the Python process.
- It interacts directly with the jakarta.jms interfaces.
- It is focused on native OpenWire/JMS messaging — for developers who need the full fidelity of a JMS client in Python.
JAR Dependencies
The following JARs are included in the libs/ folder:
- activemq-all-6.1.7.jar
- jakarta.jms-api-3.1.0.jar
- log4j-api-2.25.0.jar
- log4j-core-2.25.0.jar
Feel free to update them to newer versions as needed.
Requirements
- Python 3.8+
- Java 11 or newer (Java 17+ recommended for better JPype support)
- JPype 1.4.1+ (pip install jpype1)
Contribution
Contributions, suggestions, or improvements are welcome!
License
This project is released under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jmspy-0.1.1.tar.gz.
File metadata
- Download URL: jmspy-0.1.1.tar.gz
- Upload date:
- Size: 12.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13ac49ff0f2a98db50f74755d50be60f97e2266ffc7b2823575aae3602049de6
|
|
| MD5 |
bcbe082399009f14a5bc40de3bbbdb7d
|
|
| BLAKE2b-256 |
9f402f6e1d44a7e8de5365defbdd45fb8c60912c6c01d4f65ef94723c3cd964a
|
File details
Details for the file jmspy-0.1.1-py3-none-any.whl.
File metadata
- Download URL: jmspy-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43cdf00e65bfa745ca513657830e483004517ad2d7d3bab197a259c076153be7
|
|
| MD5 |
1e163087db86025dffecca98ba26a4c7
|
|
| BLAKE2b-256 |
593bcbd2ef5a38e5be0b85c3ff767537bc2c387d312f8a00b782a89230689e03
|