public class KinesisAppender extends AbstractAppender<KinesisWriterConfig,KinesisAppenderStatistics,KinesisAppenderStatisticsMXBean>
appenderStats, batchDelay, clientEndpoint, clientFactory, discardAction, discardThreshold, lastRotationCount, lastRotationTimestamp, rotationInterval, rotationMode, sequence, threadFactory, writer, writerFactory| Constructor and Description |
|---|
KinesisAppender()
Base constructor: assigns default values to configuration properties.
|
| Modifier and Type | Method and Description |
|---|---|
protected KinesisWriterConfig |
generateWriterConfig()
Called just before a writer is created, so that the subclass can
perform substitutions on the configuration.
|
String |
getPartitionKey()
Returns the unsubstituted partition key name; see
setPartitionKey(java.lang.String). |
int |
getRetentionPeriod()
Returns the configured retention period.
|
int |
getShardCount()
Returns the configured number of shards for the stream.
|
String |
getStreamName()
Returns the unsubstituted stream name; see
setStreamName(java.lang.String). |
boolean |
isAutoCreate()
Returns the auto-creation policy.
|
protected boolean |
isMessageTooLarge(LogMessage message)
Called
AbstractAppender.append(org.apache.log4j.spi.LoggingEvent) to ensure that we don't have a single message
that violates AWS batching rules. |
void |
setAutoCreate(boolean autoCreate)
Sets the auto-creation policy: if
true, the stream will be created
if it does not already exist. |
void |
setPartitionKey(String value)
Sets the partition key associated with this appender.
|
void |
setRetentionPeriod(int value)
Sets the message retention period, in hours.
|
void |
setShardCount(int shardCount)
Sets the desired number of shards to use when creating the stream.
|
void |
setStreamName(String value)
Sets the Kinesis Stream name associated with this appender.
|
append, close, getAppenderStatistics, getBatchDelay, getClientEndpoint, getClientFactory, getDiscardAction, getDiscardThreshold, getRotationInterval, getRotationMode, getSequence, registerStatisticsBean, requiresLayout, rotate, setBatchDelay, setClientEndpoint, setClientFactory, setDiscardAction, setDiscardThreshold, setRotationInterval, setRotationMode, setSequence, unregisterStatisticsBeanpublic KinesisAppender()
public void setStreamName(String value)
This property is intended for initial configuration only. Once messages have been sent to the appender, it cannot be changed.
There is no default value. If you do not configure a stream, the appender will be disabled and will report its misconfiguration.
public String getStreamName()
setStreamName(java.lang.String).
Intended primarily for testing.public void setPartitionKey(String value)
Default value is "{startupTimestamp}".
Setting this value to blank will result in generating a pseudo-random 8-digit partition key for each message.
This property is intended for initial configuration only. Once messages have been sent to the appender, it cannot be changed.
public String getPartitionKey()
setPartitionKey(java.lang.String).
Intended primarily for testing.public void setAutoCreate(boolean autoCreate)
true, the stream will be created
if it does not already exist.public boolean isAutoCreate()
public void setShardCount(int shardCount)
public int getShardCount()
public void setRetentionPeriod(int value)
public int getRetentionPeriod()
protected KinesisWriterConfig generateWriterConfig()
AbstractAppendergenerateWriterConfig in class AbstractAppender<KinesisWriterConfig,KinesisAppenderStatistics,KinesisAppenderStatisticsMXBean>protected boolean isMessageTooLarge(LogMessage message)
AbstractAppenderAbstractAppender.append(org.apache.log4j.spi.LoggingEvent) to ensure that we don't have a single message
that violates AWS batching rules.isMessageTooLarge in class AbstractAppender<KinesisWriterConfig,KinesisAppenderStatistics,KinesisAppenderStatisticsMXBean>Copyright © 2018. All rights reserved.