Class DispatchMessage

java.lang.Object
org.axonframework.commandhandling.distributed.DispatchMessage

public abstract class DispatchMessage extends Object
Base class for dispatch messages which may be used in the CommandBusConnector upon dispatching a command to other nodes.
  • Field Details

    • commandIdentifier

      protected String commandIdentifier
    • serializedMetaData

      protected byte[] serializedMetaData
    • payloadType

      protected String payloadType
    • payloadRevision

      protected String payloadRevision
    • serializedPayload

      protected byte[] serializedPayload
    • commandName

      protected String commandName
    • expectReply

      protected boolean expectReply
  • Constructor Details

    • DispatchMessage

      protected DispatchMessage()
      Default constructor required for de-/serialization of extending classes. Do not use directly.
    • DispatchMessage

      protected DispatchMessage(CommandMessage<?> commandMessage, Serializer serializer, boolean expectReply)
      Initialized a DispatchMessage for the given commandMessage, which uses the given serializer to deserialize its contents. expectReply indicates whether the sender will be expecting a reply.
      Parameters:
      commandMessage - The message to send to the remote segment
      serializer - The serialize to serialize the message payload and metadata with
      expectReply - whether or not the sender is waiting for a reply.
  • Method Details

    • getCommandMessage

      public CommandMessage<?> getCommandMessage(Serializer serializer)
      Returns the CommandMessage wrapped in this Message.
      Parameters:
      serializer - The serializer to deserialize message contents with
      Returns:
      the CommandMessage wrapped in this Message
    • getCommandIdentifier

      public String getCommandIdentifier()
      Returns the identifier of the command carried by this instance.
      Returns:
      the identifier of the command carried by this instance as a String
    • getSerializedMetaData

      public byte[] getSerializedMetaData()
      Returns the serialized metadata of the command carried by this instance.
      Returns:
      the serialized metadata of the command carried by this instance as a byte[]
    • getPayloadType

      public String getPayloadType()
      Returns the payload type of the serialized payload of the command carried by this instance.
      Returns:
      the payload type of the serialized payload of the the command carried by this instance as a String
    • getPayloadRevision

      public String getPayloadRevision()
      Returns the payload revision of the serialized payload of the command carried by this instance.
      Returns:
      the payload revision of the serialized payload of the command carried by this instance as a String
    • getSerializedPayload

      public byte[] getSerializedPayload()
      Returns the serialized payload of the command carried by this instance.
      Returns:
      the serialized payload of the command carried by this instance as a byte[]
    • getCommandName

      public String getCommandName()
      Returns the command name of the command carried by this instance.
      Returns:
      the command name of the command carried by this instance as a String
    • isExpectReply

      public boolean isExpectReply()
      Indicates whether the sender of this message requests a reply.
      Returns:
      true if a reply is expected, otherwise false.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object