Class ZeroMqMessageProducerSpec

All Implemented Interfaces:
DisposableBean, FactoryBean<ZeroMqMessageProducer>, InitializingBean, Lifecycle, Phased, SmartLifecycle

public class ZeroMqMessageProducerSpec extends MessageProducerSpec<ZeroMqMessageProducerSpec,ZeroMqMessageProducer>
Since:
5.4
Author:
Artem Bilan, Alessio Matricardi
  • Constructor Details

    • ZeroMqMessageProducerSpec

      protected ZeroMqMessageProducerSpec(org.zeromq.ZContext context)
    • ZeroMqMessageProducerSpec

      protected ZeroMqMessageProducerSpec(org.zeromq.ZContext context, org.zeromq.SocketType socketType)
  • Method Details

    • consumeDelay

      public ZeroMqMessageProducerSpec consumeDelay(Duration consumeDelay)
      Specify a Duration to delay consumption when no data received.
      Parameters:
      consumeDelay - the Duration to delay consumption when empty.
      Returns:
      the spec
    • messageMapper

      public ZeroMqMessageProducerSpec messageMapper(InboundMessageMapper<byte[]> messageMapper)
      Provide an InboundMessageMapper to convert a consumed data into a message to produce.
      Parameters:
      messageMapper - the InboundMessageMapper to use.
      Returns:
      the spec
    • messageConverter

      public ZeroMqMessageProducerSpec messageConverter(MessageConverter messageConverter)
      Provide a MessageConverter (as an alternative to messageMapper(org.springframework.integration.mapping.InboundMessageMapper<byte[]>)) for converting a consumed data into a message to produce.
      Parameters:
      messageConverter - the MessageConverter to use.
      Returns:
      the spec
    • receiveRaw

      public ZeroMqMessageProducerSpec receiveRaw(boolean receiveRaw)
      Whether raw ZMsg is present as a payload of message to produce or it is fully converted to a Message including ZeroMqHeaders.TOPIC header (if any).
      Parameters:
      receiveRaw - to convert from ZMsg or not; defaults to convert.
      Returns:
      the spec
    • socketConfigurer

      public ZeroMqMessageProducerSpec socketConfigurer(Consumer<org.zeromq.ZMQ.Socket> socketConfigurer)
      Provide a Consumer to configure a socket with arbitrary options, like security.
      Parameters:
      socketConfigurer - the configurer for socket options.
      Returns:
      the spec
    • topics

      public ZeroMqMessageProducerSpec topics(String... topics)
      Specify topics the SocketType.SUB socket is going to use for subscription. It is ignored for all other SocketTypes supported.
      Parameters:
      topics - the topics to use.
      Returns:
      the spec
    • unwrapTopic

      public ZeroMqMessageProducerSpec unwrapTopic(boolean unwrapTopic)
      Specify if the topic that SocketType.SUB socket is going to receive is wrapped with an additional empty frame. It is ignored for all other SocketTypes supported. This attribute is set to true by default.
      Parameters:
      unwrapTopic - true if the received topic is wrapped with an additional empty frame.
      Returns:
      the spec
      Since:
      6.2.6
    • connectUrl

      public ZeroMqMessageProducerSpec connectUrl(String connectUrl)
      Configure an URL for ZMQ.Socket.connect(String).
      Parameters:
      connectUrl - the URL to connect ZeroMq socket to.
      Returns:
      the spec
    • bindPort

      public ZeroMqMessageProducerSpec bindPort(int port)
      Configure a port for TCP protocol binding via ZMQ.Socket.bind(String).
      Parameters:
      port - the port to bind ZeroMq socket to over TCP.
      Returns:
      the spec