Repository: camel Updated Branches: refs/heads/master f731798b3 -> 8609efb8a
CAMEL-10372: Fixed camel-stream component doc Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1efbc1ca Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1efbc1ca Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1efbc1ca Branch: refs/heads/master Commit: 1efbc1ca06dd692d59f2e05e96c0772b2117c0da Parents: f731798 Author: Claus Ibsen <davscl...@apache.org> Authored: Fri Oct 7 08:40:30 2016 -0500 Committer: Claus Ibsen <davscl...@apache.org> Committed: Fri Oct 7 08:40:30 2016 -0500 ---------------------------------------------------------------------- .../src/main/docs/stream-component.adoc | 5 +++-- .../camel/component/stream/StreamComponent.java | 1 + .../camel/component/stream/StreamEndpoint.java | 16 +++++++++++++++- components/readme.adoc | 6 +++--- 4 files changed, 22 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/1efbc1ca/components/camel-stream/src/main/docs/stream-component.adoc ---------------------------------------------------------------------- diff --git a/components/camel-stream/src/main/docs/stream-component.adoc b/components/camel-stream/src/main/docs/stream-component.adoc index bec0065..aa1b803 100644 --- a/components/camel-stream/src/main/docs/stream-component.adoc +++ b/components/camel-stream/src/main/docs/stream-component.adoc @@ -57,15 +57,16 @@ The Stream component has no options. // endpoint options: START -The Stream component supports 18 endpoint options which are listed below: +The Stream component supports 19 endpoint options which are listed below: {% raw %} [width="100%",cols="2,1,1m,1m,5",options="header"] |======================================================================= | Name | Group | Default | Java Type | Description -| url | common | | String | *Required* When using the stream:url URI format this option specifies the URL to stream to/from. The input/output stream will be opened using the JDK URLConnection facility. +| kind | common | | String | *Required* Kind of stream to use such as System.in or System.out. | encoding | common | | String | You can configure the encoding (is a charset name) to use text-based streams (for example message body is a String object). If not provided Camel uses the JVM default Charset. | fileName | common | | String | When using the stream:file URI format this option specifies the filename to stream to/from. +| url | common | | String | When using the stream:url URI format this option specifies the URL to stream to/from. The input/output stream will be opened using the JDK URLConnection facility. | bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored. | groupLines | consumer | | int | To group X number of lines in the consumer. For example to group 10 lines and therefore only spit out an Exchange with 10 lines instead of 1 Exchange per line. | groupStrategy | consumer | | GroupStrategy | Allows to use a custom GroupStrategy to control how to group lines. http://git-wip-us.apache.org/repos/asf/camel/blob/1efbc1ca/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamComponent.java b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamComponent.java index 2688d5a..b87a2e4 100644 --- a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamComponent.java +++ b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamComponent.java @@ -33,6 +33,7 @@ public class StreamComponent extends UriEndpointComponent { @Override protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { StreamEndpoint answer = new StreamEndpoint(uri, this); + answer.setKind(remaining); setProperties(answer, parameters); return answer; } http://git-wip-us.apache.org/repos/asf/camel/blob/1efbc1ca/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java index a49bdaa..51386ca 100644 --- a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java +++ b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java @@ -34,13 +34,15 @@ import org.slf4j.LoggerFactory; /** * The stream: component provides access to the system-in, system-out and system-err streams as well as allowing streaming of file and URL. */ -@UriEndpoint(scheme = "stream", title = "Stream", syntax = "stream:url", consumerClass = StreamConsumer.class, label = "file,system") +@UriEndpoint(scheme = "stream", title = "Stream", syntax = "stream:kind", consumerClass = StreamConsumer.class, label = "file,system") public class StreamEndpoint extends DefaultEndpoint { private static final Logger LOG = LoggerFactory.getLogger(StreamEndpoint.class); private transient Charset charset; @UriPath(enums = "in,out,err,header,file,url") @Metadata(required = "true") + private String kind; + @UriParam private String url; @UriParam private String fileName; @@ -103,6 +105,18 @@ public class StreamEndpoint extends DefaultEndpoint { // Properties //------------------------------------------------------------------------- + + public String getKind() { + return kind; + } + + /** + * Kind of stream to use such as System.in or System.out. + */ + public void setKind(String kind) { + this.kind = kind; + } + public String getFileName() { return fileName; } http://git-wip-us.apache.org/repos/asf/camel/blob/1efbc1ca/components/readme.adoc ---------------------------------------------------------------------- diff --git a/components/readme.adoc b/components/readme.adoc index 4a18a4f..6b7a1e2 100644 --- a/components/readme.adoc +++ b/components/readme.adoc @@ -13,7 +13,7 @@ Components `ahc-ws:httpUri` | To exchange data with external Websocket servers using Async Http Client. | link:camel-amqp/src/main/docs/amqp-component.adoc[AMQP] (camel-amqp) + -`amqp:destinationType:destinationName` | Messaging with AMQP protocol using Apache Qpid Client. +`amqp:destinationType:destinationName` | Messaging with AMQP protocol using Apache QPid Client. | link:camel-flink/src/main/docs/flink-component.adoc[Apache Flink] (camel-flink) + `flink:endpointType` | The flink component can be used to send DataSet jobs to Apache Flink cluster. @@ -109,7 +109,7 @@ Components `cometd:host:port/channelName` | The cometd component is a transport for working with the Jetty implementation of the cometd/bayeux protocol. | link:camel-consul/src/main/docs/consul-component.adoc[Consul] (camel-consul) + -`consul://apiEndpoint` | Camel Consul support +`consul:apiEndpoint` | Camel Consul support | link:camel-couchdb/src/main/docs/couchdb-component.adoc[CouchDB] (camel-couchdb) + `couchdb:protocol:hostname:port/database` | The couchdb component is used for integrate with CouchDB databases. @@ -499,7 +499,7 @@ Components `stomp:destination` | The stomp component is used for communicating with Stomp compliant message brokers. | link:camel-stream/src/main/docs/stream-component.adoc[Stream] (camel-stream) + -`stream:url` | The stream: component provides access to the system-in system-out and system-err streams as well as allowing streaming of file and URL. +`stream:kind` | The stream: component provides access to the system-in system-out and system-err streams as well as allowing streaming of file and URL. | link:camel-stringtemplate/src/main/docs/string-template-component.adoc[String Template] (camel-stringtemplate) + `string-template:resourceUri` | Transforms the message using a String template.