public class KeyValueMessage extends Object implements Message
Modifier and Type | Field and Description |
---|---|
protected boolean |
forceBatch |
protected String |
key |
static KeyValueMessage |
POISON_PILL |
protected boolean |
poisonPill |
protected byte[] |
value |
Modifier | Constructor and Description |
---|---|
|
KeyValueMessage() |
protected |
KeyValueMessage(String key,
byte[] value,
boolean poisonPill,
boolean forceBatch) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
boolean |
forceBatch()
A consumer reading this message must not wait for new message to process the batch.
|
String |
getId()
A message identifier.
|
int |
hashCode() |
String |
key() |
static KeyValueMessage |
of(String key) |
static KeyValueMessage |
of(String key,
byte[] value) |
static KeyValueMessage |
ofForceBatch(String key) |
static KeyValueMessage |
ofForceBatch(String key,
byte[] value)
A message that force the batch.
|
boolean |
poisonPill()
This message is a poison pill it contains no other data, a consumer reading this message will process the batch
and stop.
|
void |
readExternal(ObjectInput in) |
String |
toString() |
byte[] |
value() |
void |
writeExternal(ObjectOutput out) |
public static final KeyValueMessage POISON_PILL
protected byte[] value
protected boolean poisonPill
protected boolean forceBatch
public KeyValueMessage()
protected KeyValueMessage(String key, byte[] value, boolean poisonPill, boolean forceBatch)
public static KeyValueMessage of(String key, byte[] value)
public static KeyValueMessage of(String key)
public static KeyValueMessage ofForceBatch(String key, byte[] value)
public static KeyValueMessage ofForceBatch(String key)
public byte[] value()
public boolean poisonPill()
Message
poisonPill
in interface Message
public boolean forceBatch()
Message
forceBatch
in interface Message
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
Copyright © 2018 Nuxeo. All rights reserved.