Class ZeroMqMessageProducerSpec

java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
org.springframework.integration.dsl.IntegrationComponentSpec<S,​P>
org.springframework.integration.dsl.MessageProducerSpec<ZeroMqMessageProducerSpec,​ZeroMqMessageProducer>
org.springframework.integration.zeromq.dsl.ZeroMqMessageProducerSpec
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<ZeroMqMessageProducer>, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

public class ZeroMqMessageProducerSpec
extends org.springframework.integration.dsl.MessageProducerSpec<ZeroMqMessageProducerSpec,​ZeroMqMessageProducer>
Since:
5.4
  • Field Summary

    Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec

    PARSER, target

    Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean

    logger

    Fields inherited from interface org.springframework.beans.factory.FactoryBean

    OBJECT_TYPE_ATTRIBUTE

    Fields inherited from interface org.springframework.context.SmartLifecycle

    DEFAULT_PHASE
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected ZeroMqMessageProducerSpec​(org.zeromq.ZContext context)  
    protected ZeroMqMessageProducerSpec​(org.zeromq.ZContext context, org.zeromq.SocketType socketType)  
  • Method Summary

    Modifier and Type Method Description
    ZeroMqMessageProducerSpec bindPort​(int port)
    Configure a port for TCP protocol binding via ZMQ.Socket.bind(String).
    ZeroMqMessageProducerSpec connectUrl​(java.lang.String connectUrl)
    Configure an URL for ZMQ.Socket.connect(String).
    ZeroMqMessageProducerSpec consumeDelay​(java.time.Duration consumeDelay)
    Specify a Duration to delay consumption when no data received.
    ZeroMqMessageProducerSpec messageConverter​(org.springframework.messaging.converter.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.
    ZeroMqMessageProducerSpec messageMapper​(org.springframework.integration.mapping.InboundMessageMapper<byte[]> messageMapper)
    Provide an InboundMessageMapper to convert a consumed data into a message to produce.
    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).
    ZeroMqMessageProducerSpec socketConfigurer​(java.util.function.Consumer<org.zeromq.ZMQ.Socket> socketConfigurer)
    Provide a Consumer to configure a socket with arbitrary options, like security.
    ZeroMqMessageProducerSpec topics​(java.lang.String... topics)
    Specify topics the SocketType.SUB socket is going to use for subscription.

    Methods inherited from class org.springframework.integration.dsl.MessageProducerSpec

    autoStartup, errorChannel, errorChannel, errorMessageStrategy, id, outputChannel, outputChannel, phase, sendTimeout, shouldTrack

    Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec

    _this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stop

    Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean

    afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • consumeDelay

      public ZeroMqMessageProducerSpec consumeDelay​(java.time.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​(org.springframework.integration.mapping.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​(org.springframework.messaging.converter.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​(java.util.function.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​(java.lang.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
    • connectUrl

      public ZeroMqMessageProducerSpec connectUrl​(java.lang.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