@UriEndpoint(firstVersion="1.3.0",
scheme="stream",
title="Stream",
syntax="stream:kind",
category={FILE,SYSTEM})
public class StreamEndpoint
extends org.apache.camel.support.DefaultEndpoint
Constructor and Description |
---|
StreamEndpoint(String endpointUri,
org.apache.camel.Component component) |
Modifier and Type | Method and Description |
---|---|
org.apache.camel.Consumer |
createConsumer(org.apache.camel.Processor processor) |
protected org.apache.camel.Exchange |
createExchange(Object body,
long index,
boolean last) |
org.apache.camel.Producer |
createProducer() |
protected void |
doStart() |
int |
getAutoCloseCount() |
Charset |
getCharset() |
long |
getDelay() |
String |
getEncoding() |
String |
getFileName() |
int |
getGroupLines() |
GroupStrategy |
getGroupStrategy() |
long |
getInitialPromptDelay() |
String |
getKind() |
long |
getPromptDelay() |
String |
getPromptMessage() |
int |
getReadTimeout() |
long |
getScanStreamDelay() |
boolean |
isCloseOnDone() |
boolean |
isFileWatcher() |
boolean |
isRetry() |
boolean |
isScanStream() |
void |
setAutoCloseCount(int autoCloseCount)
Number of messages to process before closing stream on Producer side.
|
void |
setCloseOnDone(boolean closeOnDone)
This option is used in combination with Splitter and streaming to the same file.
|
void |
setDelay(long delay)
Initial delay in milliseconds before producing the stream.
|
void |
setEncoding(String encoding)
You can configure the encoding (is a charset name) to use text-based streams (for example, message body is a
String object).
|
void |
setFileName(String fileName)
When using the stream:file URI format, this option specifies the filename to stream to/from.
|
void |
setFileWatcher(boolean fileWatcher)
To use JVM file watcher to listen for file change events to support re-loading files that may be overwritten,
somewhat like tail --retry
|
void |
setGroupLines(int groupLines)
To group X number of lines in the consumer.
|
void |
setGroupStrategy(GroupStrategy strategy)
Allows to use a custom GroupStrategy to control how to group lines.
|
void |
setInitialPromptDelay(long initialPromptDelay)
Initial delay in milliseconds before showing the message prompt.
|
void |
setKind(String kind)
Kind of stream to use such as System.in or System.out.
|
void |
setPromptDelay(long promptDelay)
Optional delay in milliseconds before showing the message prompt.
|
void |
setPromptMessage(String promptMessage)
Message prompt to use when reading from stream:in; for example, you could set this to Enter a command:
|
void |
setReadTimeout(int readTimeout)
Sets the read timeout to a specified timeout, in milliseconds.
|
void |
setRetry(boolean retry)
Will retry opening the stream if it's overwritten, somewhat like tail --retry
If reading from files then you should also enable the fileWatcher option, to make it work reliable.
|
void |
setScanStream(boolean scanStream)
To be used for continuously reading a stream such as the unix tail command.
|
void |
setScanStreamDelay(long scanStreamDelay)
Delay in milliseconds between read attempts when using scanStream.
|
configureConsumer, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, doStop, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isBasicPropertyBinding, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isSingleton, isSynchronous, setBasicPropertyBinding, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toString
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception
Exception
protected org.apache.camel.Exchange createExchange(Object body, long index, boolean last)
public String getKind()
public void setKind(String kind)
public String getFileName()
public void setFileName(String fileName)
public long getDelay()
public void setDelay(long delay)
public String getEncoding()
public void setEncoding(String encoding)
public String getPromptMessage()
public void setPromptMessage(String promptMessage)
public long getPromptDelay()
public void setPromptDelay(long promptDelay)
public long getInitialPromptDelay()
public void setInitialPromptDelay(long initialPromptDelay)
public boolean isScanStream()
public void setScanStream(boolean scanStream)
public GroupStrategy getGroupStrategy()
public void setGroupStrategy(GroupStrategy strategy)
public boolean isRetry()
public void setRetry(boolean retry)
public boolean isFileWatcher()
public void setFileWatcher(boolean fileWatcher)
public boolean isCloseOnDone()
public void setCloseOnDone(boolean closeOnDone)
public long getScanStreamDelay()
public void setScanStreamDelay(long scanStreamDelay)
public int getGroupLines()
public void setGroupLines(int groupLines)
public int getAutoCloseCount()
public void setAutoCloseCount(int autoCloseCount)
public Charset getCharset()
public int getReadTimeout()
public void setReadTimeout(int readTimeout)
Apache Camel