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 protectedZeroMqMessageProducerSpec(org.zeromq.ZContext context)protectedZeroMqMessageProducerSpec(org.zeromq.ZContext context, org.zeromq.SocketType socketType) -
Method Summary
Modifier and Type Method Description ZeroMqMessageProducerSpecbindPort(int port)Configure a port for TCP protocol binding viaZMQ.Socket.bind(String).ZeroMqMessageProducerSpecconnectUrl(String connectUrl)Configure an URL forZMQ.Socket.connect(String).ZeroMqMessageProducerSpecconsumeDelay(Duration consumeDelay)Specify aDurationto delay consumption when no data received.ZeroMqMessageProducerSpecmessageConverter(MessageConverter messageConverter)Provide aMessageConverter(as an alternative tomessageMapper(org.springframework.integration.mapping.InboundMessageMapper<byte[]>)) for converting a consumed data into a message to produce.ZeroMqMessageProducerSpecmessageMapper(InboundMessageMapper<byte[]> messageMapper)Provide anInboundMessageMapperto convert a consumed data into a message to produce.ZeroMqMessageProducerSpecreceiveRaw(boolean receiveRaw)Whether rawZMsgis present as a payload of message to produce or it is fully converted to aMessageincludingZeroMqHeaders.TOPICheader (if any).ZeroMqMessageProducerSpecsocketConfigurer(Consumer<org.zeromq.ZMQ.Socket> socketConfigurer)Provide aConsumerto configure a socket with arbitrary options, like security.ZeroMqMessageProducerSpectopics(String... topics)Specify topics theSocketType.SUBsocket is going to use for subscription.Methods inherited from class org.springframework.integration.dsl.MessageProducerSpec
autoStartup, errorChannel, errorChannel, errorMessageStrategy, id, outputChannel, outputChannel, phase, sendTimeout, shouldTrackMethods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stopMethods 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 aDurationto delay consumption when no data received.- Parameters:
consumeDelay- theDurationto delay consumption when empty.- Returns:
- the spec
-
messageMapper
Provide anInboundMessageMapperto convert a consumed data into a message to produce.- Parameters:
messageMapper- theInboundMessageMapperto 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- theMessageConverterto use.- Returns:
- the spec
-
receiveRaw
Whether rawZMsgis present as a payload of message to produce or it is fully converted to aMessageincludingZeroMqHeaders.TOPICheader (if any).- Parameters:
receiveRaw- to convert fromZMsgor not; defaults to convert.- Returns:
- the spec
-
socketConfigurer
public ZeroMqMessageProducerSpec socketConfigurer(Consumer<org.zeromq.ZMQ.Socket> socketConfigurer)Provide aConsumerto configure a socket with arbitrary options, like security.- Parameters:
socketConfigurer- the configurer for socket options.- Returns:
- the spec
-
topics
Specify topics theSocketType.SUBsocket is going to use for subscription. It is ignored for all otherSocketTypes 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
-