Class ZeroMqMessageHandler

All Implemented Interfaces:
Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, Lifecycle, Ordered, ExpressionCapable, Orderable, IntegrationPattern, NamedComponent, IntegrationManagement, ManageableLifecycle, TrackableComponent, ReactiveMessageHandler

public class ZeroMqMessageHandler extends AbstractReactiveMessageHandler implements ManageableLifecycle
The AbstractReactiveMessageHandler implementation for publishing messages over ZeroMq socket. Only SocketType.PAIR, SocketType.PUB and SocketType.PUSH are supported. This component is only connecting (no Binding) to another side, e.g. ZeroMq proxy.

When the SocketType.PUB is used, the topicExpression is evaluated against a request message to inject a topic frame into a ZeroMq message if it is not null. The subscriber side must receive the topic frame first before parsing the actual data.

When the payload of the request message is a ZMsg, no any conversion and topic extraction happen: the ZMsg is sent into a socket as is and it is not destroyed for possible further reusing.

Since:
5.4
Author:
Artem Bilan
  • Constructor Details

    • ZeroMqMessageHandler

      public ZeroMqMessageHandler(org.zeromq.ZContext context, String connectUrl)
      Create an instance based on the provided ZContext and connection string.
      Parameters:
      context - the ZContext to use for creating sockets.
      connectUrl - the URL to connect the socket to.
    • ZeroMqMessageHandler

      public ZeroMqMessageHandler(org.zeromq.ZContext context, Supplier<String> connectUrl)
      Create an instance based on the provided ZContext and connection string supplier.
      Parameters:
      context - the ZContext to use for creating sockets.
      connectUrl - the supplier for URL to connect the socket to.
      Since:
      5.5.9
    • ZeroMqMessageHandler

      public ZeroMqMessageHandler(org.zeromq.ZContext context, String connectUrl, org.zeromq.SocketType socketType)
      Create an instance based on the provided ZContext, connection string and SocketType.
      Parameters:
      context - the ZContext to use for creating sockets.
      connectUrl - the URL to connect the socket to.
      socketType - the SocketType to use; only SocketType.PAIR, SocketType.PUB and SocketType.PUSH are supported.
    • ZeroMqMessageHandler

      public ZeroMqMessageHandler(org.zeromq.ZContext context, Supplier<String> connectUrl, org.zeromq.SocketType socketType)
      Create an instance based on the provided ZContext, connection string supplier and SocketType.
      Parameters:
      context - the ZContext to use for creating sockets.
      connectUrl - the supplier for URL to connect the socket to.
      socketType - the SocketType to use; only SocketType.PAIR, SocketType.PUB and SocketType.PUSH are supported.
      Since:
      5.5.9
  • Method Details