Class ZeroMqMessageHandlerSpec

java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
org.springframework.integration.dsl.IntegrationComponentSpec<S,​H>
org.springframework.integration.dsl.MessageHandlerSpec<S,​org.springframework.integration.handler.ReactiveMessageHandlerAdapter>
org.springframework.integration.dsl.ReactiveMessageHandlerSpec<ZeroMqMessageHandlerSpec,​ZeroMqMessageHandler>
org.springframework.integration.zeromq.dsl.ZeroMqMessageHandlerSpec
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<org.springframework.integration.handler.ReactiveMessageHandlerAdapter>, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, org.springframework.integration.dsl.ComponentsRegistration

public class ZeroMqMessageHandlerSpec
extends org.springframework.integration.dsl.ReactiveMessageHandlerSpec<ZeroMqMessageHandlerSpec,​ZeroMqMessageHandler>
The ReactiveMessageHandlerSpec extension for ZeroMqMessageHandler.
Since:
5.4
  • Field Summary

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

    reactiveMessageHandler

    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 ZeroMqMessageHandlerSpec​(org.zeromq.ZContext context, java.lang.String connectUrl)
    Create an instance based on the provided ZContext and connection string.
    protected ZeroMqMessageHandlerSpec​(org.zeromq.ZContext context, java.lang.String connectUrl, org.zeromq.SocketType socketType)
    Create an instance based on the provided ZContext, connection string and SocketType.
  • Method Summary

    Modifier and Type Method Description
    ZeroMqMessageHandlerSpec messageConverter​(org.springframework.messaging.converter.MessageConverter messageConverter)
    Provide a MessageConverter (as an alternative to messageMapper(org.springframework.integration.mapping.OutboundMessageMapper<byte[]>)) for converting a request message into byte[] for sending into ZeroMq socket.
    ZeroMqMessageHandlerSpec messageMapper​(org.springframework.integration.mapping.OutboundMessageMapper<byte[]> messageMapper)
    Provide an OutboundMessageMapper to convert a request message into byte[] for sending into ZeroMq socket.
    ZeroMqMessageHandlerSpec socketConfigurer​(java.util.function.Consumer<org.zeromq.ZMQ.Socket> socketConfigurer)
    Provide a Consumer to configure a socket with arbitrary options, like security.
    ZeroMqMessageHandlerSpec topic​(java.lang.String topic)
    Specify a topic the SocketType.PUB socket is going to use for distributing messages into the subscriptions.
    ZeroMqMessageHandlerSpec topicExpression​(java.lang.String topicExpression)
    Specify a SpEL expression to evaluate a topic a SocketType.PUB is going to use for distributing messages into the subscriptions.It is ignored for all other SocketTypes supported.
    ZeroMqMessageHandlerSpec topicExpression​(org.springframework.expression.Expression topicExpression)
    Specify a SpEL expression to evaluate a topic a SocketType.PUB is going to use for distributing messages into the subscriptions.It is ignored for all other SocketTypes supported.
    ZeroMqMessageHandlerSpec topicFunction​(java.util.function.Function<org.springframework.messaging.Message<?>,​java.lang.String> topicFunction)
    Specify a Function to evaluate a topic a SocketType.PUB is going to use for distributing messages into the subscriptions.It is ignored for all other SocketTypes supported.

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

    getComponentsToRegister

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

    _this, createInstance, destroyInstance, doGet, 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

    • ZeroMqMessageHandlerSpec

      protected ZeroMqMessageHandlerSpec​(org.zeromq.ZContext context, java.lang.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.
    • ZeroMqMessageHandlerSpec

      protected ZeroMqMessageHandlerSpec​(org.zeromq.ZContext context, java.lang.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.
  • Method Details

    • messageMapper

      public ZeroMqMessageHandlerSpec messageMapper​(org.springframework.integration.mapping.OutboundMessageMapper<byte[]> messageMapper)
      Provide an OutboundMessageMapper to convert a request message into byte[] for sending into ZeroMq socket.
      Parameters:
      messageMapper - the OutboundMessageMapper to use.
      Returns:
      the spec
    • messageConverter

      public ZeroMqMessageHandlerSpec messageConverter​(org.springframework.messaging.converter.MessageConverter messageConverter)
      Provide a MessageConverter (as an alternative to messageMapper(org.springframework.integration.mapping.OutboundMessageMapper<byte[]>)) for converting a request message into byte[] for sending into ZeroMq socket.
      Parameters:
      messageConverter - the MessageConverter to use.
      Returns:
      the spec
    • socketConfigurer

      public ZeroMqMessageHandlerSpec 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
    • topic

      public ZeroMqMessageHandlerSpec topic​(java.lang.String topic)
      Specify a topic the SocketType.PUB socket is going to use for distributing messages into the subscriptions. It is ignored for all other SocketTypes supported.
      Parameters:
      topic - the topic to use.
      Returns:
      the spec
    • topicFunction

      public ZeroMqMessageHandlerSpec topicFunction​(java.util.function.Function<org.springframework.messaging.Message<?>,​java.lang.String> topicFunction)
      Specify a Function to evaluate a topic a SocketType.PUB is going to use for distributing messages into the subscriptions.It is ignored for all other SocketTypes supported.
      Parameters:
      topicFunction - the Function to evaluate topic for publishing.
      Returns:
      the spec
    • topicExpression

      public ZeroMqMessageHandlerSpec topicExpression​(java.lang.String topicExpression)
      Specify a SpEL expression to evaluate a topic a SocketType.PUB is going to use for distributing messages into the subscriptions.It is ignored for all other SocketTypes supported.
      Parameters:
      topicExpression - the expression to evaluate topic for publishing.
      Returns:
      the spec
    • topicExpression

      public ZeroMqMessageHandlerSpec topicExpression​(org.springframework.expression.Expression topicExpression)
      Specify a SpEL expression to evaluate a topic a SocketType.PUB is going to use for distributing messages into the subscriptions.It is ignored for all other SocketTypes supported.
      Parameters:
      topicExpression - the expression to evaluate topic for publishing.
      Returns:
      the spec