Class DefaultGateway

    • Constructor Detail

      • DefaultGateway

        public DefaultGateway​(GridgoContext context,
                              java.lang.String name)
    • Method Detail

      • send

        public void send​(io.gridgo.framework.support.Message message)
      • sendWithAck

        public org.joo.promise4j.Promise<io.gridgo.framework.support.Message,​java.lang.Exception> sendWithAck​(io.gridgo.framework.support.Message message)
      • call

        public org.joo.promise4j.Promise<io.gridgo.framework.support.Message,​java.lang.Exception> call​(io.gridgo.framework.support.Message message)
      • callAndPush

        public void callAndPush​(io.gridgo.framework.support.Message message)
        Description copied from interface: Gateway
        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 usual send().
        Parameters:
        message - the message
      • push

        public org.joo.promise4j.Promise<io.gridgo.framework.support.Message,​java.lang.Exception> push​(@NonNull
                                                                                                             @NonNull io.gridgo.framework.support.Message message)
        Description copied from interface: Gateway
        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
      • setAutoStart

        public GatewaySubscription setAutoStart​(boolean autoStart)
        Description copied from interface: GatewaySubscription
        Set the gateway autoStart flag.
        Parameters:
        autoStart - the autoStart value
        Returns:
        the GatewaySubscription itself
      • setProducerInstrumenter

        public GatewaySubscription setProducerInstrumenter​(io.gridgo.framework.execution.ProducerInstrumenter instrumenter)
      • isAutoStart

        public boolean isAutoStart()
        Description copied from interface: Gateway
        Check if this gateway is auto-started.
        Returns:
        true if and only if the gateway is configured to be auto-started