public class RedisDocumentMessageConsumer extends AbstractConsumer<DocumentMessage>
Modifier and Type | Field and Description |
---|---|
protected byte[] |
addDocumentSHA |
protected static String |
BATCH_ID_TAG |
protected static String |
DATA_KEY_SUFFIX |
protected static String |
DEFAULT_REDIS_PREFIX |
protected static String |
DOC_KEY_SUFFIX |
protected static String |
FOLDER_KEY_SUFFIX |
protected static com.fasterxml.jackson.databind.ObjectMapper |
OBJECT_MAPPER |
protected RedisExecutor |
redisExecutor |
protected String |
redisPrefix |
consumerId
Constructor and Description |
---|
RedisDocumentMessageConsumer(String consumerId,
String redisPrefix) |
Modifier and Type | Method and Description |
---|---|
void |
accept(DocumentMessage message)
Consume a message.
|
void |
begin()
Begin a batch of messages.
|
protected byte[] |
bytes(String val) |
void |
commit()
End of the batch message.
|
protected String |
getPayload(DocumentMessage message,
String properties) |
protected String |
getProperties(DocumentMessage message) |
protected String |
getPropertiesWithBlob(DocumentMessage message) |
void |
rollback()
Called when there is an exception during
Consumer.accept(Message) or Consumer.commit() . |
close, getConsumerId
protected static final String DEFAULT_REDIS_PREFIX
protected static final String DOC_KEY_SUFFIX
protected static final String DATA_KEY_SUFFIX
protected static final String FOLDER_KEY_SUFFIX
protected static final String BATCH_ID_TAG
protected static final com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPER
protected final byte[] addDocumentSHA
protected final RedisExecutor redisExecutor
protected final String redisPrefix
public RedisDocumentMessageConsumer(String consumerId, String redisPrefix)
public void accept(DocumentMessage message)
Consumer
protected String getPayload(DocumentMessage message, String properties)
protected String getPropertiesWithBlob(DocumentMessage message)
protected String getProperties(DocumentMessage message) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingException
public void rollback()
Consumer
Consumer.accept(Message)
or Consumer.commit()
.Copyright © 2018 Nuxeo. All rights reserved.