MATLAB Answers

How do I integrate ZeroMQ library with Matlab. I want my Matlab program to be a subscriber of ZeroMQ publisher.

94 views (last 30 days)
Hullas Sehgal
Hullas Sehgal on 19 Feb 2016
Answered: Ivan Kostin on 11 Jun 2021
How do I integrate ZeroMQ with Matlab. I would like my Matlab program to be a subscriber of ZeroMQ message, which is a publisher. Thank you.

Answers (2)

Will Grant
Will Grant on 12 Jan 2017
Edited: Will Grant on 12 Jan 2017
From this blog post, it appears that the usage of JeroMQ (a pure-java implementation of ZeroMQ) is the easiest route to go.
1. Clone the repo from https://github.com/zeromq/jeromq
2. Install maven
3. get into the repository root and build with
mvn package
4. Put the .jar file [somewhere]
5. Add [somewhere] to your javaclasspath
6. Import the package and enjoy!
Edit
Adding the following useful links with example matlab code

Ivan Kostin
Ivan Kostin on 11 Jun 2021
From this post we can understand that the latest Matlab versions do not work with the latest JDK versions. Only 7 or 8 are supported.
But last version of JeroMQ from gihub seems to use JDK with version >=9. Because after I ran the example from git I got exception like this:
java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer;
at zmq.Signaler.send(Signaler.java:134)
...
I wonder if anyone has solved the JeroMQ in Matlab problem. Seems impossible.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!