Class ZeroMqMessageHandlerSpec
java.lang.Object
org.springframework.integration.dsl.IntegrationComponentSpec<S,H>
org.springframework.integration.dsl.MessageHandlerSpec<S,ReactiveMessageHandlerAdapter>
org.springframework.integration.dsl.ReactiveMessageHandlerSpec<ZeroMqMessageHandlerSpec,ZeroMqMessageHandler>
org.springframework.integration.zeromq.dsl.ZeroMqMessageHandlerSpec
- All Implemented Interfaces:
DisposableBean
,FactoryBean<ReactiveMessageHandlerAdapter>
,InitializingBean
,Lifecycle
,Phased
,SmartLifecycle
,ComponentsRegistration
public class ZeroMqMessageHandlerSpec
extends ReactiveMessageHandlerSpec<ZeroMqMessageHandlerSpec,ZeroMqMessageHandler>
The
ReactiveMessageHandlerSpec
extension for ZeroMqMessageHandler
.- Since:
- 5.4
- Author:
- Artem Bilan, Alessio Matricardi
-
Field Summary
Fields inherited from class org.springframework.integration.dsl.ReactiveMessageHandlerSpec
reactiveMessageHandler
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
ZeroMqMessageHandlerSpec
(org.zeromq.ZContext context) Create an instance based on the providedZContext
.protected
ZeroMqMessageHandlerSpec
(org.zeromq.ZContext context, int port) Create an instance based on the providedZContext
and binding port.protected
ZeroMqMessageHandlerSpec
(org.zeromq.ZContext context, int port, org.zeromq.SocketType socketType) Create an instance based on the providedZContext
, binding port andSocketType
.protected
ZeroMqMessageHandlerSpec
(org.zeromq.ZContext context, String connectUrl) Create an instance based on the providedZContext
and connection string.protected
ZeroMqMessageHandlerSpec
(org.zeromq.ZContext context, String connectUrl, org.zeromq.SocketType socketType) Create an instance based on the providedZContext
, connection string andSocketType
.protected
ZeroMqMessageHandlerSpec
(org.zeromq.ZContext context, Supplier<String> connectUrl) Create an instance based on the providedZContext
and connection string supplier.protected
ZeroMqMessageHandlerSpec
(org.zeromq.ZContext context, Supplier<String> connectUrl, org.zeromq.SocketType socketType) Create an instance based on the providedZContext
, connection string supplier andSocketType
.protected
ZeroMqMessageHandlerSpec
(org.zeromq.ZContext context, org.zeromq.SocketType socketType) Create an instance based on the providedZContext
andSocketType
. -
Method Summary
Modifier and TypeMethodDescriptionmessageConverter
(MessageConverter messageConverter) Provide aMessageConverter
(as an alternative tomessageMapper(org.springframework.integration.mapping.OutboundMessageMapper<byte[]>)
) for converting a request message intobyte[]
for sending into ZeroMq socket.messageMapper
(OutboundMessageMapper<byte[]> messageMapper) Provide anOutboundMessageMapper
to convert a request message intobyte[]
for sending into ZeroMq socket.socketConfigurer
(Consumer<org.zeromq.ZMQ.Socket> socketConfigurer) Provide aConsumer
to configure a socket with arbitrary options, like security.Specify a topic theSocketType.PUB
socket is going to use for distributing messages into the subscriptions.topicExpression
(String topicExpression) Specify a SpEL expression to evaluate a topic aSocketType.PUB
is going to use for distributing messages into the subscriptions.It is ignored for all otherSocketType
s supported.topicExpression
(Expression topicExpression) Specify a SpEL expression to evaluate a topic aSocketType.PUB
is going to use for distributing messages into the subscriptions.It is ignored for all otherSocketType
s supported.topicFunction
(Function<Message<?>, String> topicFunction) Specify aFunction
to evaluate a topic aSocketType.PUB
is going to use for distributing messages into the subscriptions.It is ignored for all otherSocketType
s supported.wrapTopic
(boolean wrapTopic) Specify if the topic thatSocketType.PUB
socket is going to use for distributing messages into the subscriptions must be wrapped with an additional empty frame.Methods inherited from class org.springframework.integration.dsl.ReactiveMessageHandlerSpec
getComponentsToRegister
Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, afterPropertiesSet, destroy, doGet, 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
-
ZeroMqMessageHandlerSpec
Create an instance based on the providedZContext
and connection string.- Parameters:
context
- theZContext
to use for creating sockets.connectUrl
- the URL to connect the socket to.
-
ZeroMqMessageHandlerSpec
protected ZeroMqMessageHandlerSpec(org.zeromq.ZContext context) Create an instance based on the providedZContext
. The created socket will be bound to a random port.- Parameters:
context
- theZContext
to use for creating sockets.- Since:
- 6.4
-
ZeroMqMessageHandlerSpec
protected ZeroMqMessageHandlerSpec(org.zeromq.ZContext context, int port) Create an instance based on the providedZContext
and binding port.- Parameters:
context
- theZContext
to use for creating sockets.port
- the port to bind ZeroMq socket to over TCP.- Since:
- 6.4
-
ZeroMqMessageHandlerSpec
Create an instance based on the providedZContext
and connection string supplier.- Parameters:
context
- theZContext
to use for creating sockets.connectUrl
- the supplier for URL to connect the socket to.- Since:
- 5.5.9
-
ZeroMqMessageHandlerSpec
protected ZeroMqMessageHandlerSpec(org.zeromq.ZContext context, String connectUrl, org.zeromq.SocketType socketType) Create an instance based on the providedZContext
, connection string andSocketType
.- Parameters:
context
- theZContext
to use for creating sockets.connectUrl
- the URL to connect the socket to.socketType
- theSocketType
to use; onlySocketType.PAIR
,SocketType.PUB
andSocketType.PUSH
are supported.
-
ZeroMqMessageHandlerSpec
protected ZeroMqMessageHandlerSpec(org.zeromq.ZContext context, org.zeromq.SocketType socketType) Create an instance based on the providedZContext
andSocketType
. The created socket will be bound to a random port.- Parameters:
context
- theZContext
to use for creating sockets.socketType
- theSocketType
to use; onlySocketType.PAIR
,SocketType.PUB
andSocketType.PUSH
are supported.- Since:
- 6.4
-
ZeroMqMessageHandlerSpec
protected ZeroMqMessageHandlerSpec(org.zeromq.ZContext context, int port, org.zeromq.SocketType socketType) Create an instance based on the providedZContext
, binding port andSocketType
.- Parameters:
context
- theZContext
to use for creating sockets.port
- the port to bind ZeroMq socket to over TCP.socketType
- theSocketType
to use; onlySocketType.PAIR
,SocketType.PUB
andSocketType.PUSH
are supported.- Since:
- 6.4
-
ZeroMqMessageHandlerSpec
protected ZeroMqMessageHandlerSpec(org.zeromq.ZContext context, Supplier<String> connectUrl, org.zeromq.SocketType socketType) Create an instance based on the providedZContext
, connection string supplier andSocketType
.- Parameters:
context
- theZContext
to use for creating sockets.connectUrl
- the supplier for URL to connect the socket to.socketType
- theSocketType
to use; onlySocketType.PAIR
,SocketType.PUB
andSocketType.PUSH
are supported.
-
-
Method Details
-
messageMapper
Provide anOutboundMessageMapper
to convert a request message intobyte[]
for sending into ZeroMq socket.- Parameters:
messageMapper
- theOutboundMessageMapper
to use.- Returns:
- the spec
-
messageConverter
Provide aMessageConverter
(as an alternative tomessageMapper(org.springframework.integration.mapping.OutboundMessageMapper<byte[]>)
) for converting a request message intobyte[]
for sending into ZeroMq socket.- Parameters:
messageConverter
- theMessageConverter
to use.- Returns:
- the spec
-
socketConfigurer
Provide aConsumer
to configure a socket with arbitrary options, like security.- Parameters:
socketConfigurer
- the configurer for socket options.- Returns:
- the spec
-
topic
Specify a topic theSocketType.PUB
socket is going to use for distributing messages into the subscriptions. It is ignored for all otherSocketType
s supported.- Parameters:
topic
- the topic to use.- Returns:
- the spec
-
wrapTopic
Specify if the topic thatSocketType.PUB
socket is going to use for distributing messages into the subscriptions must be wrapped with an additional empty frame. It is ignored for all otherSocketType
s supported. This attribute is set totrue
by default.- Parameters:
wrapTopic
- true if the topic must be wrapped with an additional empty frame.- Returns:
- the spec
- Since:
- 6.2.6
-
topicFunction
Specify aFunction
to evaluate a topic aSocketType.PUB
is going to use for distributing messages into the subscriptions.It is ignored for all otherSocketType
s supported.- Parameters:
topicFunction
- theFunction
to evaluate topic for publishing.- Returns:
- the spec
-
topicExpression
Specify a SpEL expression to evaluate a topic aSocketType.PUB
is going to use for distributing messages into the subscriptions.It is ignored for all otherSocketType
s supported.- Parameters:
topicExpression
- the expression to evaluate topic for publishing.- Returns:
- the spec
-
topicExpression
Specify a SpEL expression to evaluate a topic aSocketType.PUB
is going to use for distributing messages into the subscriptions.It is ignored for all otherSocketType
s supported.- Parameters:
topicExpression
- the expression to evaluate topic for publishing.- Returns:
- the spec
-