Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

JeroMQ is a pure Java implementation of the ZeroMQ messaging library, offering high-performance asynchronous messaging for distributed or concurrent applications.

License

NotificationsYou must be signed in to change notification settings

zeromq/jeromq

Repository files navigation

Pure Java implementation of libzmq (http://zeromq.org).

CircleCIQuality Gate StatusCoverage StatusMaven CentralJavadocs

Features

  • Based on libzmq 4.1.7.

  • ZMTP/3.0 (http://rfc.zeromq.org/spec:23).

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

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

  • Securities

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

  • Exactly same developer experience with zeromq and jzmq.

  • TCP KeepAlive Count, Idle and Interval are known to only work with JVM 13 and later.

Unsupported

  • 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.

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

Contributing

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

Usage

Maven

Add it to your Maven project'spom.xml:

    <dependency>      <groupId>org.zeromq</groupId>      <artifactId>jeromq</artifactId>      <version>0.6.0</version>    </dependency><!-- for the latest SNAPSHOT-->    <dependency>      <groupId>org.zeromq</groupId>      <artifactId>jeromq</artifactId>      <version>0.6.0</version>    </dependency><!-- If you can't find the latest snapshot-->    <repositories>      <repository>        <id>sonatype-nexus-snapshots</id>        <url>https://oss.sonatype.org/content/repositories/snapshots</url>        <releases>          <enabled>false</enabled>        </releases>        <snapshots>          <enabled>true</enabled>        </snapshots>       </repository>    </repositories>

Ant

To generate an ant build file frompom.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 receivesand responds to them with "Hello, world!":

importorg.zeromq.SocketType;importorg.zeromq.ZMQ;importorg.zeromq.ZContext;publicclasshwserver{publicstaticvoidmain(String[]args)throwsException    {try (ZContextcontext =newZContext()) {// Socket to talk to clientsZMQ.Socketsocket =context.createSocket(SocketType.REP);socket.bind("tcp://*:5555");while (!Thread.currentThread().isInterrupted()) {// Block until a message is receivedbyte[]reply =socket.recv(0);// Print the messageSystem.out.println("Received: [" +newString(reply,ZMQ.CHARSET) +"]"                );// Send a responseStringresponse ="Hello, world!";socket.send(response.getBytes(ZMQ.CHARSET),0);            }        }    }}

More examples

The JeroMQtranslations of the zguide examples are a goodreference for recommended usage.

Documentation

For API-level documentation, see theJavadocs.

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

License

All source files are copyright © 2007-2024 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 fileLICENSE included with the JeroMQ distribution.

About

JeroMQ is a pure Java implementation of the ZeroMQ messaging library, offering high-performance asynchronous messaging for distributed or concurrent applications.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp