@UriEndpoint(scheme="stream", title="Stream", syntax="stream:url", consumerClass=StreamConsumer.class, label="file,system") public class StreamEndpoint extends DefaultEndpoint
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
StreamEndpoint(String endpointUri)
Deprecated.
|
StreamEndpoint(String endpointUri,
Component component) |
Modifier and Type | Method and Description |
---|---|
Consumer |
createConsumer(Processor processor)
Creates a new Event
Driven Consumer which consumes messages from the endpoint using the
given processor
|
protected Exchange |
createExchange(Object body,
long index,
boolean last) |
Producer |
createProducer()
Creates a new producer which is used send messages into the endpoint
|
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
int |
getAutoCloseCount() |
Charset |
getCharset() |
long |
getDelay() |
String |
getEncoding() |
String |
getFileName() |
int |
getGroupLines() |
GroupStrategy |
getGroupStrategy() |
long |
getInitialPromptDelay() |
long |
getPromptDelay() |
String |
getPromptMessage() |
long |
getScanStreamDelay() |
String |
getUrl() |
boolean |
isCloseOnDone() |
boolean |
isRetry() |
boolean |
isScanStream() |
boolean |
isSingleton()
Whether this class supports being singleton or not.
|
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 |
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 |
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 |
setRetry(boolean retry)
Will retry opening the file if it's overwritten, somewhat like tail --retry
|
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, Component component) throws Exception
Exception
@Deprecated public StreamEndpoint(String endpointUri)
public Consumer createConsumer(Processor processor) throws Exception
Endpoint
processor
- the given processorException
- can be thrownpublic Producer createProducer() throws Exception
Endpoint
Exception
- can be thrownpublic boolean isSingleton()
IsSingleton
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 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()
protected void doStart() throws Exception
ServiceSupport
Important: See ServiceSupport.doStop()
for more details.
doStart
in class DefaultEndpoint
Exception
ServiceSupport.doStop()
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.