Package org.graylog2.indexer.messages
Interface ImmutableMessage
- All Superinterfaces:
Acknowledgeable,Indexable
- All Known Implementing Classes:
SerializationMemoizingMessage
The purpose of this interface is to provide access to certain properties of a
Message while ensuring that
it can't be changed anymore. This allows precomputation and re-use of e.g. the serialized JSON of a message (see
Indexable.serialize(SerializationContext) while ensuring that the precomputed value does not become invalid
when the message content would be changed.
For example, the interface can be used in the output path to compute the space required by a Message in a
batch request to OpenSearch. Batch computation happens early in the process and when the actual index request is to
be sent, the precomputed serialized value can be re-used with certainty that the message has not been altered in
the meantime.
-
Method Summary
Modifier and TypeMethodDescriptiongetId()Returns the id to address the document in Elasticsearch.com.google.common.collect.ImmutableSet<IndexSet>com.google.common.collect.ImmutableSet<String>static ImmutableMessageMethods inherited from interface org.graylog2.shared.messageq.Acknowledgeable
getMessageQueueIdMethods inherited from interface org.graylog2.indexer.messages.Indexable
getMessageId, getReceiveTime, getSize, getTimestamp, serialize, supportsFailureHandling, toElasticSearchObject
-
Method Details
-
wrap
-
getId
String getId()Description copied from interface:IndexableReturns the id to address the document in Elasticsearch. Depending on the implementation this might return aUUIDorULIDThis method should only be used where backwards compatibility is needed. Newer code should useIndexable.getMessageId()instead. -
getIndexSets
com.google.common.collect.ImmutableSet<IndexSet> getIndexSets() -
getFields
-
getMessage
String getMessage() -
getField
-
getSource
String getSource() -
getStreamIds
com.google.common.collect.ImmutableSet<String> getStreamIds()
-