JeroMQ v0.5.0 Release Notes

Release Date: 2019-02-18 // about 5 years ago
  • โž• Added

    • #539, #552, #573: Implemented heartbeating between sockets as specified in https://rfc.zeromq.org/spec:37/ZMTP.

    • #556: There is now a SocketType enum that can be used when creating sockets. This is recommended over the old way of using integer values, which is error-prone. The overload of ZContext.createSocket that takes an integer is still supported, but is now marked deprecated.

    • #559: Added recvStream and recvStrStream instance methods to the ZMQ.Socket class. These expose a Stream of incoming messages, each of which is a byte[] or String, respectively.

    • #560: ZMsg instance methods can now be chained.

    • #576: Added an overload of ZMsg.recvMsg that takes a Consumer<ZMsg> handler and a Consumer<ZMQException> exceptionHandler for handling the result of attempting to receive a message on a socket.

    • #586: Implemented a Timer API based on the one added to libzmq in version 4.2.

    • #590: Added a closeSelector method to the ZContext class, to expose a way for selectors created by createSelector to be closed. Note that both of these methods are also deprecated; it is not recommended to manage selectors directly, as these are managed for you by pollers.

    • #614: Added a ZMQ_SELECTOR_PROVIDERCHOOSER socket option that allows you to define a custom SelectorProvider.

    ๐Ÿ”„ Changed

    • ๐Ÿ‘ JeroMQ no longer supports Java 7. Dropping support for Java 7 allows us to leverage the new features of Java 8, including the use of lambda syntax to create IAttachedRunnable and IDetachedRunnable.

    • ๐Ÿ”จ Refactored code to use Java 8 features like lambdas and streams in various places. See #570 and #650, for example.

    • #510: Polling now measures time in nanoseconds instead of microseconds, ensuring a higher degree of precision.

    • ๐Ÿ›  #523: Fixed a bug where ZLoop was closing the context.

    • ๐Ÿ›  #525: Fixed a bug in zmq.io.StreamEngine that was causing an infinite loop in the IO thread, blocking the application with 100% CPU usage.

    • ๐Ÿ›  #527: Fixed a bug in zmq.io.StreamEngine where data could still be present inside the handshake buffer that was not decoded.

    • ๐Ÿ›  #535: Fixed an edge case where, once in a blue moon, after a socket fails to connect, and is subsequently closed, it would still try to reconnect as if it weren't closed.

    • ๐Ÿš€ #546: Prior to this release, when a ZContext was initialized, its internal ZMQ.Context would be null initially, and the ZContext isClosed instance method would misleadingly return true; the ZMQ.Context was being created lazily when getContext was called on the ZContext. Worse, the internal context would be reset to null after closing a ZContext, which could lead to problems if another thread happened to try to use the ZContext after it was closed, resulting in a new ZMQ.Context secretly being created. Now, the internal ZMQ.Context is created upon initialization of the ZContext, and you can rely on it never being null.

    • โšก๏ธ #548: Various javadoc updates and improvements. There is now a @Draft annotation to identify work-in-progress APIs that are unstable or experimental.

    • ๐Ÿ›  #552: Fixed a bug where internal command messages (e.g. HEARTBEAT commands) were disrupting the REQ state machine.

    • #564: Implemented the ability to bind a socket via IPC or TCP with a dynamic ("wildcard") port and retrieve it via ZMQ.ZMQ_LAST_ENDPOINT. Leveraged this to make our test suite more reliable.

    • ๐Ÿ›  #569: Fixed an issue where an overridable method was being used in the ZStar constructor.

    • ๐Ÿ›  #578: Fixed an issue where an errno of 48 ("address already in use") would persist longer than intended in the process of binding to a random port. Now, errno is reset to 0 after a port is found.

    • ๐Ÿ›  #581: Fixed a bug where, if you're polling in one thread and you close the context in another thread, it would result in an uncaught ClosedSelectorException.

    • ๐Ÿ›  #583: Fixed a race condition causing ZMQ_CONNECT_RID to sometimes be assigned to the wrong peer socket.

    • ๐Ÿ›  #597: Fixed a bug causing the context to hang indefinitely after calling destroy(), if multiple sockets had connected to the same socket.

    • #609: For numerous methods, when invalid arguments are passed to the method, an InvalidArgumentException with a friendly error message will now be thrown, instead of an assertion error.

    • #610: Added some asserts in places where there could potentially be NullPointerExceptions.

    • #623: Options.rcvbuf and Options.sndbuf will now adjust Config.IN_BATCH_SIZE and Config.OUT_BATCH_SIZE accordingly.

    • #634: We are now using a 64-bit long, instead of a 32-bit integer, as a cursor in the internal java.zmq.Signaler class. This change should not affect the library user, except that it will now take longer for the value to overflow. Previously, with the 32-bit integer cursor, the Signaler could overflow within a month or so under heavy load, causing serious problems such as a server being unable to accept new client connections.

    • #642, #646, #652: Removed debug printing intended for development use only.

    • #643: Added some checks in parts of the codebase related to encryption and authentication mechanisms.

    • #652: IOExceptions that occur during polling will now set errno more accurately depending on the exception. Previously, the errno would always be set to EINTR when an IOException occurs during polling.

    • #653: ZError.toString now defaults to "errno " + Integer.toString(code) if a string version of that error code hasn't been implemented.

    • #654: In a low-level place where an IllegalStateException was thrown with no arguments before, the string value of the errno is now included to provide some context.

    • #655: In a low-level place in the polling code, EINTR is now correctly reported to indicate that polling was interrupted, whereas we used to miss it and try to poll again.

    • #657: When destroying a ZPoller, we will no longer close the poller's Selector, as that is handled by the context.

    • #659: Made internal optimizations to ZContext. The only visible change should be that the order of the sockets when you call getSockets() is no longer deterministic, as we are now storing them internally in a Set rather than a List.

    • #660: When creating a socket and the maxSockets limit is reached, a ZMQException is now thrown instead of the more generic IllegalStateException.