This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new bd7fcaf CAMEL-12530: Polished
bd7fcaf is described below
commit bd7fcaf27baebe41edaf812eb51858e56561bbfe
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Jun 26 12:52:17 2018 +0200
CAMEL-12530: Polished
---
components/camel-web3j/src/main/docs/web3j-component.adoc | 4 ++--
.../org/apache/camel/component/web3j/Web3jConfiguration.java | 11 +++++++++--
.../java/org/apache/camel/component/web3j/Web3jEndpoint.java | 5 +----
.../web3j/springboot/Web3jComponentConfiguration.java | 1 +
4 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/components/camel-web3j/src/main/docs/web3j-component.adoc
b/components/camel-web3j/src/main/docs/web3j-component.adoc
index daecf52..f3a7a7f 100644
--- a/components/camel-web3j/src/main/docs/web3j-component.adoc
+++ b/components/camel-web3j/src/main/docs/web3j-component.adoc
@@ -48,7 +48,7 @@ The Web3j Ethereum Blockchain component supports 2 options,
which are listed bel
The Web3j Ethereum Blockchain endpoint is configured using URI syntax:
----
-web3j:host:port
+web3j:nodeAddress
----
with the following path and query parameters:
@@ -76,7 +76,7 @@ with the following path and query parameters:
| *gasLimit* (common) | The maximum gas allowed in this block. | | BigInteger
| *toAddress* (common) | The address the transaction is directed to. | |
String
| *toBlock* (common) | The block number, or the string latest for the last
mined block or pending, earliest for not yet mined transactions. | latest |
DefaultBlockParameter
-| *topics* (common) | Topics are order-dependent. Each topic can also be a
list of topics. | | List
+| *topics* (common) | Topics are order-dependent. Each topic can also be a
list of topics. Specify multiple topics separated by comma. | | String
| *web3j* (common) | The preconfigured Web3j object. | | Web3j
| *bridgeErrorHandler* (consumer) | 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 or ERROR level and ignored. | false |
boolean
| *exceptionHandler* (consumer) | To let the consumer use a custom
ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this
options is not in use. By default the consumer will deal with exceptions, that
will be logged at WARN or ERROR level and ignored. | | ExceptionHandler
diff --git
a/components/camel-web3j/src/main/java/org/apache/camel/component/web3j/Web3jConfiguration.java
b/components/camel-web3j/src/main/java/org/apache/camel/component/web3j/Web3jConfiguration.java
index a4c78ae..d06929f 100644
---
a/components/camel-web3j/src/main/java/org/apache/camel/component/web3j/Web3jConfiguration.java
+++
b/components/camel-web3j/src/main/java/org/apache/camel/component/web3j/Web3jConfiguration.java
@@ -17,6 +17,7 @@
package org.apache.camel.component.web3j;
import java.math.BigInteger;
+import java.util.Arrays;
import java.util.List;
import org.apache.camel.RuntimeCamelException;
@@ -47,8 +48,8 @@ public class Web3jConfiguration implements Cloneable {
@UriParam(label = "producer")
private String address;
- @UriParam(label = "common")
- private List<String> topics; //TODO doesn't support list of lists
+ @UriParam(label = "common", javaType = "String")
+ private List<String> topics;
@UriParam(label = "producer")
private BigInteger position;
@@ -456,11 +457,17 @@ public class Web3jConfiguration implements Cloneable {
/**
* Topics are order-dependent. Each topic can also be a list of topics.
+ * Specify multiple topics separated by comma.
*/
public void setTopics(List<String> topics) {
this.topics = topics;
}
+ public void setTopics(String topics) {
+ String[] arr = topics.split(",");
+ this.topics = Arrays.asList(arr);
+ }
+
public String getAddress() {
return address;
}
diff --git
a/components/camel-web3j/src/main/java/org/apache/camel/component/web3j/Web3jEndpoint.java
b/components/camel-web3j/src/main/java/org/apache/camel/component/web3j/Web3jEndpoint.java
index 6eb171b..cf69f64 100644
---
a/components/camel-web3j/src/main/java/org/apache/camel/component/web3j/Web3jEndpoint.java
+++
b/components/camel-web3j/src/main/java/org/apache/camel/component/web3j/Web3jEndpoint.java
@@ -38,13 +38,10 @@ import org.web3j.protocol.http.HttpService;
import org.web3j.protocol.ipc.UnixIpcService;
import org.web3j.protocol.ipc.WindowsIpcService;
-// TODO: should it say web3j compliant content repository. Should it not say
something about blockchain,bitcoin
-// TODO: label should be bitcoin,blockchain (web3j is already in the JAR
name)
-
/**
* The web3j component uses the Web3j client API and allows you to add/read
nodes to/from a web3j compliant content repositories.
*/
-@UriEndpoint(firstVersion = "2.22.0", scheme = "web3j", title = "Web3j
Ethereum Blockchain", syntax = "web3j:host:port",
+@UriEndpoint(firstVersion = "2.22.0", scheme = "web3j", title = "Web3j
Ethereum Blockchain", syntax = "web3j:nodeAddress",
consumerClass = Web3jConsumer.class, label = "bitcoin,blockchain")
public class Web3jEndpoint extends DefaultEndpoint {
private static final Logger LOG =
LoggerFactory.getLogger(Web3jEndpoint.class);
diff --git
a/platforms/spring-boot/components-starter/camel-web3j-starter/src/main/java/org/apache/camel/component/web3j/springboot/Web3jComponentConfiguration.java
b/platforms/spring-boot/components-starter/camel-web3j-starter/src/main/java/org/apache/camel/component/web3j/springboot/Web3jComponentConfiguration.java
index ac2f9e2..946fa84 100644
---
a/platforms/spring-boot/components-starter/camel-web3j-starter/src/main/java/org/apache/camel/component/web3j/springboot/Web3jComponentConfiguration.java
+++
b/platforms/spring-boot/components-starter/camel-web3j-starter/src/main/java/org/apache/camel/component/web3j/springboot/Web3jComponentConfiguration.java
@@ -173,6 +173,7 @@ public class Web3jComponentConfiguration
private List addresses;
/**
* Topics are order-dependent. Each topic can also be a list of topics.
+ * Specify multiple topics separated by comma.
*/
private List topics;
/**