Class MsgModuleSender

java.lang.Object
com.scaleoutsoftware.modules.client.MsgModuleSender

public class MsgModuleSender extends Object
The MsgModuleSender sends messages to modules.
  • Constructor Details

    • MsgModuleSender

      public MsgModuleSender(com.scaleout.client.GridConnection connection)
      Instantiate the MsgModuleSender.
      Parameters:
      connection - the GridConnection.
  • Method Details

    • sendToModule

      public CompletableFuture<Void> sendToModule(String moduleName, String objectId, byte[] message)
      Sends a messages to a module with a default timeout of 5 seconds.
      Parameters:
      moduleName - the module name.
      objectId - the unique SOSS object id.
      message - the serialized message.
      Returns:
      a CompletableFuture that returns null upon successful completion. If an exception occurs in message processing or the request times out, an exception is reported.
    • sendToModule

      public CompletableFuture<Void> sendToModule(String moduleName, String objectId, byte[] message, Duration timeout)
      Sends a messages to a module with a configurable timeout.
      Parameters:
      moduleName - the module name.
      objectId - the unique SOSS object id.
      message - the serialized message.
      timeout - the duration of time in seconds before a timeout occurs.
      Returns:
      a CompletableFuture that returns null upon successful completion. If an exception occurs in message processing or the request times out, an exception is reported