Package org.graylog2.plugin.journal
Class RawMessage
java.lang.Object
org.graylog2.plugin.journal.RawMessage
- All Implemented Interfaces:
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:
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionRawMessage
(byte[] payload) RawMessage
(byte[] payload, InetSocketAddress remoteAddress) RawMessage
(byte[] payload, ResolvableInetSocketAddress remoteAddress) RawMessage
(long journalOffset, com.eaio.uuid.UUID id, org.joda.time.DateTime timestamp, ResolvableInetSocketAddress remoteAddress, byte[] payload) RawMessage
(JournalMessages.JournalMessage journalMessage, Object messageQueueId) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSourceNode
(String sourceInputId, NodeId nodeId) static RawMessage
decode
(byte[] buffer, long journalOffset) static RawMessage
byte[]
encode()
com.eaio.uuid.UUID
getId()
byte[]
long
Deprecated.byte[]
int
org.joda.time.DateTime
int
void
setCodecConfig
(Configuration codecConfig) void
setCodecName
(String name) void
void
setSequenceNr
(int sequenceNr) toString()
-
Field Details
-
CURRENT_VERSION
public static final byte CURRENT_VERSION- See Also:
-
-
Constructor Details
-
RawMessage
public RawMessage(@Nonnull byte[] payload) -
RawMessage
-
RawMessage
-
RawMessage
public RawMessage(long journalOffset, @Nonnull com.eaio.uuid.UUID id, org.joda.time.DateTime timestamp, @Nullable ResolvableInetSocketAddress remoteAddress, @Nonnull byte[] payload) -
RawMessage
-
-
Method Details
-
addSourceNode
-
decode
-
decode
-
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
-
setRemoteAddress
-
getCodecName
-
setCodecName
-
getCodecConfig
-
setCodecConfig
-
getSourceNodes
-
setSequenceNr
public void setSequenceNr(int sequenceNr) -
getSequenceNr
public int getSequenceNr() -
toString
-
getMessageQueueId
-
getJournalOffset
Deprecated.usegetMessageQueueId()
instead
-
getMessageQueueId()
instead