@UriEndpoint(firstVersion="1.3.0", scheme="stream", title="Stream", syntax="stream:kind", consumerClass=StreamConsumer.class, label="file,system") public class StreamEndpoint extends org.apache.camel.impl.DefaultEndpoint
Constructor and Description |
---|
StreamEndpoint(String endpointUri)
Deprecated.
|
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() |
int |
getConnectTimeout() |
long |
getDelay() |
String |
getEncoding() |
String |
getFileName() |
int |
getGroupLines() |
GroupStrategy |
getGroupStrategy() |
Map<String,Object> |
getHttpHeaders() |
long |
getInitialPromptDelay() |
String |
getKind() |
long |
getPromptDelay() |
String |
getPromptMessage() |
int |
getReadTimeout() |
long |
getScanStreamDelay() |
String |
getUrl() |
boolean |
isCloseOnDone() |
boolean |
isFileWatcher() |
boolean |
isRetry() |
boolean |
isScanStream() |
boolean |
isSingleton() |
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 |
setConnectTimeout(int connectTimeout)
Sets a specified timeout value, in milliseconds, to be used
when opening a communications link to the resource referenced
by this URLConnection.
|
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 |
setHttpHeaders(Map<String,Object> httpHeaders)
Optional http headers to use in request when using HTTP URL.
|
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.
|
void |
setUrl(String url)
When using the stream:url URI format, this option specifies the URL to stream to/from.
|
configureConsumer, configurePollingConsumer, configureProperties, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, doStop, equals, getCamelContext, getComponent, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isBridgeErrorHandler, isLenientProperties, isPollingConsumerBlockWhenFull, isSynchronous, setBridgeErrorHandler, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toString
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public StreamEndpoint(String endpointUri, org.apache.camel.Component component) throws Exception
Exception
@Deprecated public StreamEndpoint(String endpointUri)
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception
Exception
public boolean isSingleton()
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 String getUrl()
public void setUrl(String url)
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 void setHttpHeaders(Map<String,Object> httpHeaders)
public int getConnectTimeout()
public void setConnectTimeout(int connectTimeout)
public int getReadTimeout()
public void setReadTimeout(int readTimeout)
Apache Camel