Skip to content
Pure Java ZeroMQ
Branch: master
Clone or download
daveyarwood Merge pull request #720 from trevorbernard/master
Fix #719 - Remove rebuilding selector debug statement
Latest commit 8b4a296 Apr 17, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Add support for circleci build Feb 18, 2019
doc update pom.xml release plugin settings and docs to reflect automated … Apr 4, 2019
scripts improve run-example script: re-compile examples Apr 25, 2018
src Fix #719 - Remove rebuilding selector debug statement Apr 17, 2019
.gitignore Ignore .checkstyle file Nov 19, 2014
.travis.yml Merge pull request #714 from daveyarwood/travis-cache-maven-deps Apr 13, 2019
AUTHORS 0.5.1 changelog Apr 5, 2019 Update C4 link in Nov 17, 2017
LICENSE change license from LGPL to MPLv2 Sep 8, 2016 Update latest version in Apr 17, 2019
pom.xml update pom.xml release plugin settings and docs to reflect automated … Apr 4, 2019


Pure Java implementation of libzmq (

Build Status Coverage Status Maven Central Javadocs


  • Based on libzmq 4.1.7.

  • ZMTP/3.0 (

  • tcp:// protocol and inproc:// is compatible with zeromq.

  • ipc:// protocol works only between jeromq (uses tcp:// internally).

  • Securities

  • Performance that's not too bad, compared to native libzmq.

  • Exactly same developer experience with zeromq and jzmq.


  • ipc:// protocol with zeromq. Java doesn't support UNIX domain socket.

  • pgm:// protocol. Cannot find a pgm Java implementation.

  • norm:// protocol. Cannot find a Java implementation.

  • tipc:// protocol. Cannot find a Java implementation.

  • GSSAPI mechanism is not yet implemented.

  • TCP KeepAlive Count, Idle, Interval cannot be set via Java but as OS level.

  • Interrupting threads is still unsupported: library is NOT Thread.interrupt safe.


Contributions welcome! See for details about the contribution process and useful development tasks.



Add it to your Maven project's pom.xml:


    <!-- for the latest SNAPSHOT -->

    <!-- If you can't find the latest snapshot -->


To generate an ant build file from pom.xml, issue the following command:

mvn ant:ant

Getting started

Simple example

Here is how you might implement a server that prints the messages it receives and responds to them with "Hello, world!":

import org.zeromq.ZMQ;
import org.zeromq.ZContext;

public class hwserver
    public static void main(String[] args) throws Exception
        try (ZContext context = new ZContext()) {
            // Socket to talk to clients
            ZMQ.Socket socket = context.createSocket(ZMQ.REP);

            while (!Thread.currentThread().isInterrupted()) {
                // Block until a message is received
                byte[] reply = socket.recv(0);

                // Print the message
                    "Received: [" + new String(reply, ZMQ.CHARSET) + "]"

                // Send a response
                String response = "Hello, world!";
                socket.send(response.getBytes(ZMQ.CHARSET), 0);

More examples

The JeroMQ translations of the zguide examples are a good reference for recommended usage.

(Note that the Java examples in the zguide itself are out of date and do not necessarily reflect current recommended practices with JeroMQ.)


For API-level documentation, see the Javadocs.

This repo also has a doc folder, which contains assorted "how to do X" guides and other useful information about various topics related to using JeroMQ.


All source files are copyright © 2007-2018 contributors as noted in the AUTHORS file.

Free use of this software is granted under the terms of the Mozilla Public License 2.0. For details see the file LICENSE included with the JeroMQ distribution.

You can’t perform that action at this time.