Class ZeroMqChannelSpec

java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
org.springframework.integration.dsl.IntegrationComponentSpec<S,​C>
org.springframework.integration.dsl.MessageChannelSpec<ZeroMqChannelSpec,​ZeroMqChannel>
org.springframework.integration.zeromq.dsl.ZeroMqChannelSpec
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<ZeroMqChannel>, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, org.springframework.integration.dsl.ComponentsRegistration

public class ZeroMqChannelSpec
extends org.springframework.integration.dsl.MessageChannelSpec<ZeroMqChannelSpec,​ZeroMqChannel>
The MessageChannelSpec for a ZeroMqChannel.
Since:
5.4
  • Field Summary

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

    channel

    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 ZeroMqChannelSpec​(org.zeromq.ZContext context, boolean pubSub)  
  • Method Summary

    Modifier and Type Method Description
    ZeroMqChannelSpec connectUrl​(java.lang.String connectUrl)
    Configure a connection to the ZeroMQ proxy with the pair of ports over colon for proxy frontend and backend sockets.
    ZeroMqChannelSpec consumeDelay​(java.time.Duration consumeDelay)
    Specify a Duration to delay consumption when no data received.
    ZeroMqChannelSpec messageMapper​(org.springframework.integration.mapping.BytesMessageMapper messageMapper)
    Provide a BytesMessageMapper to convert to/from messages when send or receive happens on the sockets.
    ZeroMqChannelSpec sendSocketConfigurer​(java.util.function.Consumer<org.zeromq.ZMQ.Socket> sendSocketConfigurer)
    The Consumer callback to configure a publishing socket.
    ZeroMqChannelSpec subscribeSocketConfigurer​(java.util.function.Consumer<org.zeromq.ZMQ.Socket> subscribeSocketConfigurer)
    The Consumer callback to configure a consuming socket.
    ZeroMqChannelSpec zeroMqProxy​(ZeroMqProxy zeroMqProxy)
    Specify a reference to a ZeroMqProxy instance in the same application to rely on its ports configuration and make a natural lifecycle dependency without guessing when the proxy is started.

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

    datatype, doGet, getComponentsToRegister, interceptor, messageConverter, wireTap, wireTap, wireTap

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

    _this, createInstance, destroyInstance, get, getId, getObjectType, getPhase, id, 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

    • ZeroMqChannelSpec

      protected ZeroMqChannelSpec​(org.zeromq.ZContext context, boolean pubSub)
  • Method Details

    • connectUrl

      public ZeroMqChannelSpec connectUrl​(java.lang.String connectUrl)
      Configure a connection to the ZeroMQ proxy with the pair of ports over colon for proxy frontend and backend sockets. Mutually exclusive with the zeroMqProxy(ZeroMqProxy).
      Parameters:
      connectUrl - the connection string in format PROTOCOL://HOST:FRONTEND_PORT:BACKEND_PORT, e.g. tcp://localhost:6001:6002
      Returns:
      the spec
    • zeroMqProxy

      public ZeroMqChannelSpec zeroMqProxy​(ZeroMqProxy zeroMqProxy)
      Specify a reference to a ZeroMqProxy instance in the same application to rely on its ports configuration and make a natural lifecycle dependency without guessing when the proxy is started. Mutually exclusive with the connectUrl(String).
      Parameters:
      zeroMqProxy - the ZeroMqProxy instance to use
      Returns:
      the spec
    • consumeDelay

      public ZeroMqChannelSpec consumeDelay​(java.time.Duration consumeDelay)
      Specify a Duration to delay consumption when no data received.
      Parameters:
      consumeDelay - the Duration to delay consumption when empty; defaults to ZeroMqChannel.DEFAULT_CONSUME_DELAY.
      Returns:
      the spec
    • messageMapper

      public ZeroMqChannelSpec messageMapper​(org.springframework.integration.mapping.BytesMessageMapper messageMapper)
      Provide a BytesMessageMapper to convert to/from messages when send or receive happens on the sockets.
      Parameters:
      messageMapper - the BytesMessageMapper to use.
      Returns:
      the spec
    • sendSocketConfigurer

      public ZeroMqChannelSpec sendSocketConfigurer​(java.util.function.Consumer<org.zeromq.ZMQ.Socket> sendSocketConfigurer)
      The Consumer callback to configure a publishing socket.
      Parameters:
      sendSocketConfigurer - the Consumer to use.
      Returns:
      the spec
    • subscribeSocketConfigurer

      public ZeroMqChannelSpec subscribeSocketConfigurer​(java.util.function.Consumer<org.zeromq.ZMQ.Socket> subscribeSocketConfigurer)
      The Consumer callback to configure a consuming socket.
      Parameters:
      subscribeSocketConfigurer - the Consumer to use.
      Returns:
      the spec