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:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,DisposableBean
,FactoryBean<ZeroMqMessageProducer>
,InitializingBean
,Lifecycle
,Phased
,SmartLifecycle
public class ZeroMqMessageProducerSpec extends MessageProducerSpec<ZeroMqMessageProducerSpec,ZeroMqMessageProducer>
- Since:
- 5.4
- Author:
- Artem Bilan
-
Field Summary
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
PARSER, target
-
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 viaZMQ.Socket.bind(String)
.ZeroMqMessageProducerSpec
connectUrl(String connectUrl)
Configure an URL forZMQ.Socket.connect(String)
.ZeroMqMessageProducerSpec
consumeDelay(Duration consumeDelay)
Specify aDuration
to delay consumption when no data received.ZeroMqMessageProducerSpec
messageConverter(MessageConverter messageConverter)
Provide aMessageConverter
(as an alternative tomessageMapper(org.springframework.integration.mapping.InboundMessageMapper<byte[]>)
) for converting a consumed data into a message to produce.ZeroMqMessageProducerSpec
messageMapper(InboundMessageMapper<byte[]> messageMapper)
Provide anInboundMessageMapper
to convert a consumed data into a message to produce.ZeroMqMessageProducerSpec
receiveRaw(boolean receiveRaw)
Whether rawZMsg
is present as a payload of message to produce or it is fully converted to aMessage
includingZeroMqHeaders.TOPIC
header (if any).ZeroMqMessageProducerSpec
socketConfigurer(Consumer<org.zeromq.ZMQ.Socket> socketConfigurer)
Provide aConsumer
to configure a socket with arbitrary options, like security.ZeroMqMessageProducerSpec
topics(String... topics)
Specify topics theSocketType.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
-
Constructor Details
-
ZeroMqMessageProducerSpec
protected ZeroMqMessageProducerSpec(org.zeromq.ZContext context) -
ZeroMqMessageProducerSpec
protected ZeroMqMessageProducerSpec(org.zeromq.ZContext context, org.zeromq.SocketType socketType)
-
-
Method Details
-
consumeDelay
Specify aDuration
to delay consumption when no data received.- Parameters:
consumeDelay
- theDuration
to delay consumption when empty.- Returns:
- the spec
-
messageMapper
Provide anInboundMessageMapper
to convert a consumed data into a message to produce.- Parameters:
messageMapper
- theInboundMessageMapper
to use.- Returns:
- the spec
-
messageConverter
Provide aMessageConverter
(as an alternative tomessageMapper(org.springframework.integration.mapping.InboundMessageMapper<byte[]>)
) for converting a consumed data into a message to produce.- Parameters:
messageConverter
- theMessageConverter
to use.- Returns:
- the spec
-
receiveRaw
Whether rawZMsg
is present as a payload of message to produce or it is fully converted to aMessage
includingZeroMqHeaders.TOPIC
header (if any).- Parameters:
receiveRaw
- to convert fromZMsg
or not; defaults to convert.- Returns:
- the spec
-
socketConfigurer
public ZeroMqMessageProducerSpec socketConfigurer(Consumer<org.zeromq.ZMQ.Socket> socketConfigurer)Provide aConsumer
to configure a socket with arbitrary options, like security.- Parameters:
socketConfigurer
- the configurer for socket options.- Returns:
- the spec
-
topics
Specify topics theSocketType.SUB
socket is going to use for subscription. It is ignored for all otherSocketType
s supported.- Parameters:
topics
- the topics to use.- Returns:
- the spec
-
connectUrl
Configure an URL forZMQ.Socket.connect(String)
.- Parameters:
connectUrl
- the URL to connect ZeroMq socket to.- Returns:
- the spec
-
bindPort
Configure a port for TCP protocol binding viaZMQ.Socket.bind(String)
.- Parameters:
port
- the port to bind ZeroMq socket to over TCP.- Returns:
- the spec
-