Class RawMessage

java.lang.Object
org.graylog2.plugin.journal.RawMessage
All Implemented Interfaces:
Serializable

public class RawMessage extends Object implements Serializable
A raw message is the unparsed data Graylog was handed by an input.

Typically this is a copy of the exact bytes received over the network, after all de-chunking, removal of transport headers, etc has been performed, but before any parsing, decoding, checking of the actual payload has been performed.

Each raw message has a unique id, a timestamp it was received at (this might be different from the timestamp contained in the payload, if that has any), a tag of what payload type this is supposed to be (e.g. syslog, GELF, RadioMessage etc.), as well as an opaque meta data structure.
The format of the meta data is not stable yet, but will likely be a JSON string.

See Also:
  • Field Details

  • Constructor Details

    • RawMessage

      public RawMessage(@Nonnull byte[] payload)
    • RawMessage

      public RawMessage(@Nonnull byte[] payload, @Nullable InetSocketAddress remoteAddress)
    • RawMessage

      public RawMessage(@Nonnull byte[] payload, @Nullable ResolvableInetSocketAddress remoteAddress)
    • RawMessage

      public RawMessage(long journalOffset, @Nonnull com.eaio.uuid.UUID id, org.joda.time.DateTime timestamp, @Nullable ResolvableInetSocketAddress remoteAddress, @Nonnull byte[] payload)
    • RawMessage

      public RawMessage(JournalMessages.JournalMessage journalMessage, Object messageQueueId)
  • Method Details

    • addSourceNode

      public void addSourceNode(String sourceInputId, NodeId nodeId)
    • decode

      @Nullable public static RawMessage decode(byte[] buffer, Object messageQueueId)
    • decode

      @Nullable public static RawMessage decode(byte[] buffer, long journalOffset)
    • encode

      public byte[] encode()
    • getVersion

      public int getVersion()
    • getTimestamp

      public org.joda.time.DateTime getTimestamp()
    • getPayload

      public byte[] getPayload()
    • getId

      public com.eaio.uuid.UUID getId()
    • getIdBytes

      public byte[] getIdBytes()
    • getRemoteAddress

      @Nullable public ResolvableInetSocketAddress getRemoteAddress()
    • setRemoteAddress

      public void setRemoteAddress(ResolvableInetSocketAddress address)
    • getCodecName

      public String getCodecName()
    • setCodecName

      public void setCodecName(String name)
    • getCodecConfig

      public Configuration getCodecConfig()
    • setCodecConfig

      public void setCodecConfig(Configuration codecConfig)
    • getSourceNodes

      public List<RawMessage.SourceNode> getSourceNodes()
    • setSequenceNr

      public void setSequenceNr(int sequenceNr)
    • getSequenceNr

      public int getSequenceNr()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getMessageQueueId

      public Object getMessageQueueId()
    • getJournalOffset

      @Deprecated public long getJournalOffset()
      Deprecated.