Package io.gridgo.core
Interface Gateway
-
- All Superinterfaces:
io.gridgo.framework.ComponentLifecycle
,io.gridgo.connector.support.MessageProducer
,io.gridgo.framework.NamedComponent
,Streamable<RoutingContext>
- All Known Implementing Classes:
AbstractGatewaySubscription
,DefaultGateway
public interface Gateway extends io.gridgo.framework.ComponentLifecycle, Streamable<RoutingContext>, io.gridgo.connector.support.MessageProducer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
callAndPush(io.gridgo.framework.support.Message message)
Send a message and wait for response.java.util.List<ConnectorAttachment>
getConnectorAttachments()
Get the list of attached connectors.boolean
isAutoStart()
Check if this gateway is auto-started.org.joo.promise4j.Promise<io.gridgo.framework.support.Message,java.lang.Exception>
push(io.gridgo.framework.support.Message message)
Push a message to the gateway incoming sink, so it will be routed the subscribers.-
Methods inherited from interface io.gridgo.connector.support.MessageProducer
call, callAny, callAny, send, sendAny, sendAny, sendAnyWithAck, sendAnyWithAck, sendWithAck
-
Methods inherited from interface io.gridgo.core.support.Streamable
asObservable
-
-
-
-
Method Detail
-
getConnectorAttachments
java.util.List<ConnectorAttachment> getConnectorAttachments()
Get the list of attached connectors.- Returns:
- the list of attached connectors
-
push
org.joo.promise4j.Promise<io.gridgo.framework.support.Message,java.lang.Exception> push(io.gridgo.framework.support.Message message)
Push a message to the gateway incoming sink, so it will be routed the subscribers. The subscriber may or may not send back a response. If there is no response the promise will never be completed.- Parameters:
message
- the message to be pushed- Returns:
- the promise
-
callAndPush
void callAndPush(io.gridgo.framework.support.Message message)
Send a message and wait for response. The response will then be pushed into the gateway incoming sink instead of returning to the caller. Some connectors might not support it. If there are multiple connectors attached to the gateway, only the first one is actually called, the rest are usualsend()
.- Parameters:
message
- the message
-
isAutoStart
boolean isAutoStart()
Check if this gateway is auto-started.- Returns:
- true if and only if the gateway is configured to be auto-started
-
-