• Stars
    star
    584
  • Rank 76,554 (Top 2 %)
  • Language
    Java
  • License
    GNU General Publi...
  • Created almost 15 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Java binding for ZeroMQ

What is JZMQ?

This is the Java language binding for libzmq (aka ZeroMQ, 0MQ).

Build Status

The latest javadocs.

Building and Installing JZMQ

To build you need to have the libzmq library already installed, then you run:

cd jzmq-jni/
./autogen.sh
./configure
make
make install
cd ..
mvn package

If you hope to install to your local maven, then you should run:

mvn install -Dgpg.skip=true

Building Windows 64bit with CMake & NMake

It is recommended to follow these steps with the Visual C++ 2015 Build Tools.

  1. create a new and empty directory:
d:\temp\>mkdir JZMQ
d:\temp\>cd JZMQ
d:\temp\JZMQ\>
  1. Clone the repository to your new directory
d:\temp\JZMQ\>git clone https://github.com/zeromq/jzmq.git
  1. dive into the checkedout repository and create a new build64 folder
d:\temp\JZMQ\>cd jzmq\jzmq-jni
d:\temp\JZMQ\jzmq\jzmq-jni\>mkdir build64
d:\temp\JZMQ\jzmq\jzmq-jni\>cd build64
  1. Now call CMake to generate the project
D:\temp\JZMQ\jzmq\jzmq-jni\build64>cmake .. -G "NMake Makefiles" -DZMQ_C_INCLUDE_PATH=<path to zmq include> -DZMQ_C_LIB_PATH=<path to zmq library>
-- The C compiler identification is MSVC 19.0.24210.0
-- The CXX compiler identification is MSVC 19.0.24210.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Java: C:/Program Files/Java/jdk1.8.0_91/bin/java.exe (found version "1.8.0.91")
-- Found JNI: C:/Program Files/Java/jdk1.8.0_91/lib/jawt.lib
-- Configuring done
-- Generating done
-- Build files have been written to: D:/temp/JZMQ/jzmq/jzmq-jni/build64
  1. Now finally call NMake to build the zmq.jar and jzmq.lib, jzmq.dll
D:\temp\JZMQ\jzmq\jzmq-jni\build64>nmake
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation.  All rights reserved.

[ 10%] Generating config.hpp
[ 20%] Generating org/zeromq/ZMQ.class, org/zeromq/Utils.class, org/zeromq/ZMQ$$Context.class, org/zeromq/ZMQ$$Socket.class, org/zeromq/ZMQ$$PollItem.class, org/zeromq/ZMQ$$Poller.class, org/zeromq/ZM
Q$$Error.class, org/zeromq/ZMQException.class, org/zeromq/ZMQQueue.class, org/zeromq/ZMQForwarder.class, org/zeromq/ZMQStreamer.class, org/zeromq/EmbeddedLibraryTools.class, org/zeromq/App.class, org/
zeromq/ZContext.class, org/zeromq/ZDispatcher.class, org/zeromq/ZDispatcher$$1.class, org/zeromq/ZDispatcher$$SocketDispatcher$$1.class, org/zeromq/ZDispatcher$$SocketDispatcher$$2.class, org/zeromq/Z
Dispatcher$$SocketDispatcher$$ZMessageBuffer.class, org/zeromq/ZDispatcher$$SocketDispatcher.class, org/zeromq/ZDispatcher$$ZMessageHandler.class, org/zeromq/ZDispatcher$$ZSender.class, org/zeromq/ZFr
ame.class, org/zeromq/ZMsg.class, org/zeromq/ZLoop.class, org/zeromq/ZLoop$$IZLoopHandler.class, org/zeromq/ZLoop$$SPoller.class, org/zeromq/ZLoop$$STimer.class, org/zeromq/ZThread.class, org/zeromq/Z
Thread$$IAttachedRunnable.class, org/zeromq/ZThread$$IDetachedRunnable.class, org/zeromq/ZThread$$ShimThread.class
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
[ 30%] Generating org_zeromq_ZMQ.h, org_zeromq_ZMQ_Error.h, org_zeromq_ZMQ_Context.h, org_zeromq_ZMQ_Socket.h, org_zeromq_ZMQ_PollItem.h, org_zeromq_ZMQ_Poller.h
[ 40%] Generating lib/zmq.jar
Scanning dependencies of target jzmq
[ 40%] Generating org/zeromq/ZMQ.class, org/zeromq/Utils.class, org/zeromq/ZMQ$$Context.class, org/zeromq/ZMQ$$Socket.class, org/zeromq/ZMQ$$PollItem.class, org/zeromq/ZMQ$$Poller.class, org/zeromq/ZM
Q$$Error.class, org/zeromq/ZMQException.class, org/zeromq/ZMQQueue.class, org/zeromq/ZMQForwarder.class, org/zeromq/ZMQStreamer.class, org/zeromq/EmbeddedLibraryTools.class, org/zeromq/App.class, org/
zeromq/ZContext.class, org/zeromq/ZDispatcher.class, org/zeromq/ZDispatcher$$1.class, org/zeromq/ZDispatcher$$SocketDispatcher$$1.class, org/zeromq/ZDispatcher$$SocketDispatcher$$2.class, org/zeromq/Z
Dispatcher$$SocketDispatcher$$ZMessageBuffer.class, org/zeromq/ZDispatcher$$SocketDispatcher.class, org/zeromq/ZDispatcher$$ZMessageHandler.class, org/zeromq/ZDispatcher$$ZSender.class, org/zeromq/ZFr
ame.class, org/zeromq/ZMsg.class, org/zeromq/ZLoop.class, org/zeromq/ZLoop$$IZLoopHandler.class, org/zeromq/ZLoop$$SPoller.class, org/zeromq/ZLoop$$STimer.class, org/zeromq/ZThread.class, org/zeromq/Z
Thread$$IAttachedRunnable.class, org/zeromq/ZThread$$IDetachedRunnable.class, org/zeromq/ZThread$$ShimThread.class
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
[ 40%] Generating org_zeromq_ZMQ.h, org_zeromq_ZMQ_Error.h, org_zeromq_ZMQ_Context.h, org_zeromq_ZMQ_Socket.h, org_zeromq_ZMQ_PollItem.h, org_zeromq_ZMQ_Poller.h
[ 50%] Building CXX object CMakeFiles/jzmq.dir/src/main/c++/Context.cpp.obj
Context.cpp
[ 60%] Building CXX object CMakeFiles/jzmq.dir/src/main/c++/Poller.cpp.obj
Poller.cpp
D:\temp\JZMQ\jzmq\jzmq-jni\src\main\c++\Poller.cpp(76): warning C4244: '=': conversion from 'jint' to 'short', possible loss of data
[ 70%] Building CXX object CMakeFiles/jzmq.dir/src/main/c++/Socket.cpp.obj
Socket.cpp
D:\temp\JZMQ\jzmq\jzmq-jni\src\main\c++\Socket.cpp(266): warning C4267: 'argument': conversion from 'size_t' to 'jsize', possible loss of data
D:\temp\JZMQ\jzmq\jzmq-jni\src\main\c++\Socket.cpp(272): warning C4267: 'argument': conversion from 'size_t' to 'jsize', possible loss of data
D:\temp\JZMQ\jzmq\jzmq-jni\src\main\c++\Socket.cpp(847): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
D:\temp\JZMQ\jzmq\jzmq-jni\src\main\c++\Socket.cpp(875): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
[ 80%] Building CXX object CMakeFiles/jzmq.dir/src/main/c++/util.cpp.obj
util.cpp
[ 90%] Building CXX object CMakeFiles/jzmq.dir/src/main/c++/ZMQ.cpp.obj
ZMQ.cpp
[100%] Linking CXX shared library lib\jzmq.dll
   Creating library lib\jzmq.lib and object lib\jzmq.exp
   Creating library lib\jzmq.lib and object lib\jzmq.exp
[100%] Built target jzmq

Avoiding JNI

JZMQ uses JNI to wrap libzmq for the best performance. If performance isn't your primary goal, look at the JeroMQ project, which is a pure Java implementation that provides an identical API to JZMQ, and uses the same protocol.

Building Packages

To build a Debian package, run:

$ dpkg-buildpackage -rfakeroot

To build an RPM package, run:

$ rpmbuild -tb jzmq-X.Y.Z.tar.gz

Where X.Y.Z is replaced with the version that you've downloaded.

If configure can't find your libzmq installation, you can tell it where to look, using e.g. --with-zeromq=/usr/local.

You may want to take a look at http://www.zeromq.org/docs:tuning-zeromq for additional hints.

For more information, refer to the ØMQ website at http://www.zeromq.org/.

On Mac OS X you may need to compile and make install pkg-config if configure fails with "syntax error near unexpected token newline".
See http://stackoverflow.com/questions/3522248/how-do-i-compile-jzmq-for-zeromq-on-osx for details.

You may also need to symlink the header files of your standard Java installation (e.g. /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Headers/*.h) into a suitable directory (e.g. /usr/local/include) and point the JAVA_HOME environment variable to the parent directory (e.g./usr/local).

Acknowledgements

YourKit is kindly supporting ZeroMQ project with its full-featured Java Profiler.

Copying

Free use of this software is granted under the terms of the GNU Lesser General Public License (LGPL). For details see the files COPYING and COPYING.LESSER included with the Java binding for ØMQ.

More Repositories

1

libzmq

ZeroMQ core engine in C++, implements ZMTP/3.1
C++
8,996
star
2

pyzmq

PyZMQ: Python bindings for zeromq
Python
3,480
star
3

netmq

A 100% native C# implementation of ZeroMQ for .NET
C#
2,822
star
4

jeromq

Pure Java ZeroMQ
Java
2,288
star
5

cppzmq

Header-only C++ binding for libzmq
C++
1,737
star
6

zeromq.js

⚡ Node.js bindings to the ØMQ library
TypeScript
1,371
star
7

zmq.rs

A native implementation of ØMQ in Rust
Rust
1,124
star
8

czmq

High-level C binding for ØMQ
C
1,110
star
9

zyre

Zyre - an open-source framework for proximity-based peer-to-peer applications
C
843
star
10

goczmq

goczmq is a golang wrapper for CZMQ.
Go
552
star
11

php-zmq

ZeroMQ for PHP
C
543
star
12

zeromq4-x

ØMQ 4.x stable release branch - bug fixes only
C++
446
star
13

zmqpp

0mq 'highlevel' C++ bindings
C++
418
star
14

zeromq2-x

ØMQ/2.x distribution
C++
365
star
15

malamute

The ZeroMQ Enterprise Messaging Broker
C
311
star
16

gomq

Pure Go Implementation of a Subset of ZeroMQ
Go
290
star
17

clrzmq

CLR (.NET & Mono) binding for 0MQ
C#
272
star
18

filemq

FileMQ is a publish-subscribe file service based on 0MQ
Java
271
star
19

rbzmq

Ruby binding for 0MQ
C
248
star
20

clrzmq4

ZeroMQ C# namespace (.NET and mono, Windows, Linux and MacOSX, x86 and amd64)
C#
235
star
21

zproto

A protocol framework for ZeroMQ
C
228
star
22

zeromq3-x

ØMQ/3.2 release branch - bug fixes only
C++
228
star
23

JSMQ

Javascript client for ZeroMQ/NetMQ
JavaScript
190
star
24

chumak

Pure Erlang implementation of ZeroMQ Message Transport Protocol.
Erlang
189
star
25

erlzmq2

Erlang binding for 0MQ (v2)
C
165
star
26

libcurve

An encryption and authentication library for ZeroMQ applications
C
161
star
27

zproject

CLASS Project Generator
Shell
142
star
28

lzmq

Lua binding to ZeroMQ
Lua
133
star
29

gitdown

Turn github into your publishing platform
Perl 6
130
star
30

zeromq4-1

ZeroMQ 4.1.x stable release branch - bug fixes only
C++
125
star
31

exzmq

ZeroMQ for Elixir
Elixir
116
star
32

pyre

Python port of Zyre
Python
116
star
33

fszmq

An F# binding for the ZeroMQ distributed computing library. For more information, please visit:
F#
112
star
34

majordomo

Majordomo Project
C
111
star
35

cljzmq

Clojure bindings for ØMQ
Clojure
105
star
36

rfc

ZeroMQ RFC project
C
104
star
37

dafka

Dafka is a decentralized distributed streaming platform
C
101
star
38

gyre

Golang port of Zyre
Go
87
star
39

zwssock

ZeroMQ WebSocket library for CZMQ
C
85
star
40

jszmq

Javascript port of zeromq
TypeScript
80
star
41

libzmtp

Minimal ZMTP implementation in C
C
53
star
42

ingescape

Model-based framework for broker-free distributed software environments. Any language, any OS, web, cloud.
C
52
star
43

zbroker

Elastic pipes
C
50
star
44

czmqpp

C++ wrapper for czmq. Aims to be minimal, simple and consistent.
C++
43
star
45

zeromq.org

ZeroMQ Website
HTML
32
star
46

cookbook

ZeroMQ Cookbook
Python
32
star
47

pyczmq

Python CZMQ bindings
Python
31
star
48

zebra

REST/HTTP to XRAP gateway
C++
27
star
49

zmtpdump

ZeroMQ Transport Protocol packet analyzer
Roff
26
star
50

jeromq-jms

JeroMQ JMS
Java
25
star
51

jzmq-api

A Java ØMQ API for abstracting the various implementations of ZeroMQ Message Transport Protocol
Java
24
star
52

zmq-jni

Simple High Performance JNI Wrapper for ØMQ
Java
22
star
53

perlzmq

version agnostic Perl bindings for zeromq
Perl
22
star
54

zmtp

Stuff related to the ZMTP protocol
C
18
star
55

contiki-zmtp

ZMTP for Contiki OS
C
16
star
56

zccp

ZeroMQ Command & Control Protocol
Go
14
star
57

jyre

Java implementation of ZRE protocol
Java
14
star
58

f77_zmq

Fortran binding for ZeroMQ
C
13
star
59

ztools

Tools for ØMQ auto-builds and API site
Perl
12
star
60

zeps

ZeroMQ Enterprise Publish-Subscribe (ZEPS) **DEPRECATED**
C
12
star
61

mruby-zmq

mruby bindings for libzmq (v4)
C
11
star
62

zeromq2-0

Packaging project for ØMQ/2.0 series
C++
9
star
63

zkernel

z kernel
C
9
star
64

nimczmq

Nim ( http://nim-lang.org/ ) bindings for CZMQ
Nim
6
star
65

curvezmq-java

Java
5
star
66

gozyre

Go bindings for zeromq libzyre - an open-source framework for proximity-based peer-to-peer applications
Go
5
star
67

issues

Issue test cases
C
4
star
68

zdiscgo

CZMQ service discovery zactor with support for Go plugins.
C
4
star
69

jdafka

Dafka protocol implementation in Java
Java
4
star
70

zlabs

Labs project for experimenting with CZMQ
Shell
4
star
71

zeromq-buildbot

A buildbot based regression tester for Zeromq
Python
3
star
72

azmq1-0

v1.0 release of azmq
C++
3
star
73

lyre

Lua port of Zyre
Lua
3
star
74

jeromq3-x

Java
3
star
75

jzmq3-x

Java
2
star
76

zmtp-java

Java
2
star
77

libzmq-relicense

This repo contains information regarding re-licensing libzmq
Python
2
star
78

clrzmq2

Old repository path for clrzmq
2
star
79

libzmq-fuzz-corpora

fuzzers corpus files for libzmq are stored in binary format in this repository
1
star
80

zeromq-download-redirect

HTML
1
star