Class ZeroMqChannelSpec
java.lang.Object
org.springframework.integration.dsl.IntegrationComponentSpec<S,C>
org.springframework.integration.dsl.MessageChannelSpec<ZeroMqChannelSpec,ZeroMqChannel>
org.springframework.integration.zeromq.dsl.ZeroMqChannelSpec
- All Implemented Interfaces:
DisposableBean
,FactoryBean<ZeroMqChannel>
,InitializingBean
,Lifecycle
,Phased
,SmartLifecycle
,ComponentsRegistration
The
MessageChannelSpec
for a ZeroMqChannel
.- Since:
- 5.4
- Author:
- Artem Bilan
-
Field Summary
Fields inherited from class org.springframework.integration.dsl.MessageChannelSpec
channel
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
logger, PARSER, target
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
ModifierConstructorDescriptionprotected
ZeroMqChannelSpec
(org.zeromq.ZContext context, boolean pubSub) -
Method Summary
Modifier and TypeMethodDescriptionconnectUrl
(String connectUrl) Configure a connection to the ZeroMQ proxy with the pair of ports over colon for proxy frontend and backend sockets.consumeDelay
(Duration consumeDelay) Specify aDuration
to delay consumption when no data received.messageMapper
(BytesMessageMapper messageMapper) Provide aBytesMessageMapper
to convert to/from messages when send or receive happens on the sockets.sendSocketConfigurer
(Consumer<org.zeromq.ZMQ.Socket> sendSocketConfigurer) TheConsumer
callback to configure a publishing socket.subscribeSocketConfigurer
(Consumer<org.zeromq.ZMQ.Socket> subscribeSocketConfigurer) TheConsumer
callback to configure a consuming socket.zeroMqProxy
(ZeroMqProxy zeroMqProxy) Specify a reference to aZeroMqProxy
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, afterPropertiesSet, destroy, getId, getObject, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.FactoryBean
isSingleton
-
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 aZeroMqProxy
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 theconnectUrl(String)
.- Parameters:
zeroMqProxy
- theZeroMqProxy
instance to use- Returns:
- the spec
-
consumeDelay
Specify aDuration
to delay consumption when no data received.- Parameters:
consumeDelay
- theDuration
to delay consumption when empty; defaults toZeroMqChannel.DEFAULT_CONSUME_DELAY
.- Returns:
- the spec
-
messageMapper
Provide aBytesMessageMapper
to convert to/from messages when send or receive happens on the sockets.- Parameters:
messageMapper
- theBytesMessageMapper
to use.- Returns:
- the spec
-
sendSocketConfigurer
TheConsumer
callback to configure a publishing socket.- Parameters:
sendSocketConfigurer
- theConsumer
to use.- Returns:
- the spec
-
subscribeSocketConfigurer
public ZeroMqChannelSpec subscribeSocketConfigurer(Consumer<org.zeromq.ZMQ.Socket> subscribeSocketConfigurer) TheConsumer
callback to configure a consuming socket.- Parameters:
subscribeSocketConfigurer
- theConsumer
to use.- Returns:
- the spec
-