Class RedisDocumentMessageConsumer
- java.lang.Object
-
- org.nuxeo.lib.stream.pattern.consumer.AbstractConsumer<DocumentMessage>
-
- org.nuxeo.importer.stream.consumer.RedisDocumentMessageConsumer
-
- All Implemented Interfaces:
AutoCloseable
,Consumer<DocumentMessage>
public class RedisDocumentMessageConsumer extends AbstractConsumer<DocumentMessage>
Consumes DocumentMessage and send them to Redis which can be used as Gatling feeder.- Since:
- 10.2
-
-
Field Summary
Fields Modifier and Type Field 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
-
Fields inherited from class org.nuxeo.lib.stream.pattern.consumer.AbstractConsumer
consumerId
-
-
Constructor Summary
Constructors Constructor Description RedisDocumentMessageConsumer(String consumerId, String redisPrefix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 duringConsumer.accept(Message)
orConsumer.commit()
.-
Methods inherited from class org.nuxeo.lib.stream.pattern.consumer.AbstractConsumer
close, getConsumerId
-
-
-
-
Field Detail
-
DEFAULT_REDIS_PREFIX
protected static final String DEFAULT_REDIS_PREFIX
- See Also:
- Constant Field Values
-
DOC_KEY_SUFFIX
protected static final String DOC_KEY_SUFFIX
- See Also:
- Constant Field Values
-
DATA_KEY_SUFFIX
protected static final String DATA_KEY_SUFFIX
- See Also:
- Constant Field Values
-
FOLDER_KEY_SUFFIX
protected static final String FOLDER_KEY_SUFFIX
- See Also:
- Constant Field Values
-
BATCH_ID_TAG
protected static final String BATCH_ID_TAG
- See Also:
- Constant Field Values
-
OBJECT_MAPPER
protected static final com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPER
-
addDocumentSHA
protected final byte[] addDocumentSHA
-
redisExecutor
protected final RedisExecutor redisExecutor
-
redisPrefix
protected final String redisPrefix
-
-
Method Detail
-
accept
public void accept(DocumentMessage message)
Description copied from interface:Consumer
Consume a message.
-
getPayload
protected String getPayload(DocumentMessage message, String properties)
-
getPropertiesWithBlob
protected String getPropertiesWithBlob(DocumentMessage message)
-
getProperties
protected String getProperties(DocumentMessage message) throws com.fasterxml.jackson.core.JsonProcessingException
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
bytes
protected byte[] bytes(String val)
-
begin
public void begin()
Description copied from interface:Consumer
Begin a batch of messages.
-
commit
public void commit()
Description copied from interface:Consumer
End of the batch message.
-
rollback
public void rollback()
Description copied from interface:Consumer
Called when there is an exception duringConsumer.accept(Message)
orConsumer.commit()
.
-
-