Package org.nuxeo.lib.stream.pattern
Class KeyValueMessage
java.lang.Object
org.nuxeo.lib.stream.pattern.KeyValueMessage
- All Implemented Interfaces:
Externalizable
,Serializable
,Message
Simple key value message.
- Since:
- 9.1
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected String
static final KeyValueMessage
protected boolean
protected byte[]
-
Constructor Summary
ModifierConstructorDescriptionprotected
KeyValueMessage
(String key, byte[] value, boolean poisonPill, boolean forceBatch) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
A consumer reading this message must not wait for new message to process the batch.getId()
A message identifier.int
hashCode()
key()
static KeyValueMessage
static KeyValueMessage
static KeyValueMessage
ofForceBatch
(String key) static KeyValueMessage
ofForceBatch
(String key, byte[] value) A message that force the batch.boolean
This message is a poison pill it contains no other data, a consumer reading this message will process the batch and stop.void
toString()
byte[]
value()
void
-
Field Details
-
POISON_PILL
-
key
-
value
protected byte[] value -
poisonPill
protected boolean poisonPill -
forceBatch
protected boolean forceBatch
-
-
Constructor Details
-
KeyValueMessage
public KeyValueMessage() -
KeyValueMessage
-
-
Method Details
-
of
-
of
-
ofForceBatch
A message that force the batch. -
ofForceBatch
-
key
-
value
public byte[] value() -
getId
Description copied from interface:Message
A message identifier. -
poisonPill
public boolean poisonPill()Description copied from interface:Message
This message is a poison pill it contains no other data, a consumer reading this message will process the batch and stop.- Specified by:
poisonPill
in interfaceMessage
-
forceBatch
public boolean forceBatch()Description copied from interface:Message
A consumer reading this message must not wait for new message to process the batch.- Specified by:
forceBatch
in interfaceMessage
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
equals
-
hashCode
public int hashCode() -
toString
-