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
-
Constructor Summary
Constructors Modifier Constructor Description protectedZeroMqChannelSpec(org.zeromq.ZContext context, boolean pubSub) -
Method Summary
Modifier and Type Method Description ZeroMqChannelSpecconnectUrl(java.lang.String connectUrl)Configure a connection to the ZeroMQ proxy with the pair of ports over colon for proxy frontend and backend sockets.ZeroMqChannelSpecconsumeDelay(java.time.Duration consumeDelay)Specify aDurationto delay consumption when no data received.ZeroMqChannelSpecmessageMapper(org.springframework.integration.mapping.BytesMessageMapper messageMapper)Provide aBytesMessageMapperto convert to/from messages when send or receive happens on the sockets.ZeroMqChannelSpecsendSocketConfigurer(java.util.function.Consumer<org.zeromq.ZMQ.Socket> sendSocketConfigurer)TheConsumercallback to configure a publishing socket.ZeroMqChannelSpecsubscribeSocketConfigurer(java.util.function.Consumer<org.zeromq.ZMQ.Socket> subscribeSocketConfigurer)TheConsumercallback to configure a consuming socket.ZeroMqChannelSpeczeroMqProxy(ZeroMqProxy zeroMqProxy)Specify a reference to aZeroMqProxyinstance 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, wireTapMethods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, createInstance, destroyInstance, get, getId, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stop
-
Constructor Details
-
ZeroMqChannelSpec
protected ZeroMqChannelSpec(org.zeromq.ZContext context, boolean pubSub)
-
-
Method Details
-
connectUrl
Configure a connection to the ZeroMQ proxy with the pair of ports over colon for proxy frontend and backend sockets. Mutually exclusive with thezeroMqProxy(ZeroMqProxy).- Parameters:
connectUrl- the connection string in formatPROTOCOL://HOST:FRONTEND_PORT:BACKEND_PORT, e.g.tcp://localhost:6001:6002- Returns:
- the spec
-
zeroMqProxy
Specify a reference to aZeroMqProxyinstance 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 theconnectUrl(String).- Parameters:
zeroMqProxy- theZeroMqProxyinstance to use- Returns:
- the spec
-
consumeDelay
Specify aDurationto delay consumption when no data received.- Parameters:
consumeDelay- theDurationto delay consumption when empty; defaults toZeroMqChannel.DEFAULT_CONSUME_DELAY.- Returns:
- the spec
-
messageMapper
public ZeroMqChannelSpec messageMapper(org.springframework.integration.mapping.BytesMessageMapper messageMapper)Provide aBytesMessageMapperto convert to/from messages when send or receive happens on the sockets.- Parameters:
messageMapper- theBytesMessageMapperto use.- Returns:
- the spec
-
sendSocketConfigurer
public ZeroMqChannelSpec sendSocketConfigurer(java.util.function.Consumer<org.zeromq.ZMQ.Socket> sendSocketConfigurer)TheConsumercallback to configure a publishing socket.- Parameters:
sendSocketConfigurer- theConsumerto use.- Returns:
- the spec
-
subscribeSocketConfigurer
public ZeroMqChannelSpec subscribeSocketConfigurer(java.util.function.Consumer<org.zeromq.ZMQ.Socket> subscribeSocketConfigurer)TheConsumercallback to configure a consuming socket.- Parameters:
subscribeSocketConfigurer- theConsumerto use.- Returns:
- the spec
-