Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"CamelHttpResponseCode",
"CamelHttpResponseText",
"CamelMqttTopic",
"CamelNatsDeliveryCounter",
"CamelNatsSID",
"CamelNatsStatusCode",
"CamelNatsStatusError",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ public class NatsEndpointConfigurer extends PropertyConfigurerSupport implements
public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
NatsEndpoint target = (NatsEndpoint) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "ackpolicy":
case "ackPolicy": target.getConfiguration().setAckPolicy(property(camelContext, io.nats.client.api.AckPolicy.class, value)); return true;
case "ackwait":
case "ackWait": target.getConfiguration().setAckWait(property(camelContext, long.class, value)); return true;
case "bridgeerrorhandler":
case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
case "connection": target.getConfiguration().setConnection(property(camelContext, io.nats.client.Connection.class, value)); return true;
Expand Down Expand Up @@ -52,12 +56,16 @@ public boolean configure(CamelContext camelContext, Object obj, String name, Obj
case "jetstreamName": target.getConfiguration().setJetstreamName(property(camelContext, java.lang.String.class, value)); return true;
case "lazystartproducer":
case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
case "maxdeliver":
case "maxDeliver": target.getConfiguration().setMaxDeliver(property(camelContext, long.class, value)); return true;
case "maxmessages":
case "maxMessages": target.getConfiguration().setMaxMessages(property(camelContext, java.lang.String.class, value)); return true;
case "maxpingsout":
case "maxPingsOut": target.getConfiguration().setMaxPingsOut(property(camelContext, int.class, value)); return true;
case "maxreconnectattempts":
case "maxReconnectAttempts": target.getConfiguration().setMaxReconnectAttempts(property(camelContext, int.class, value)); return true;
case "nackwait":
case "nackWait": target.getConfiguration().setNackWait(property(camelContext, long.class, value)); return true;
case "noecho":
case "noEcho": target.getConfiguration().setNoEcho(property(camelContext, boolean.class, value)); return true;
case "norandomizeservers":
Expand Down Expand Up @@ -96,6 +104,10 @@ public boolean configure(CamelContext camelContext, Object obj, String name, Obj
@Override
public Class<?> getOptionType(String name, boolean ignoreCase) {
switch (ignoreCase ? name.toLowerCase() : name) {
case "ackpolicy":
case "ackPolicy": return io.nats.client.api.AckPolicy.class;
case "ackwait":
case "ackWait": return long.class;
case "bridgeerrorhandler":
case "bridgeErrorHandler": return boolean.class;
case "connection": return io.nats.client.Connection.class;
Expand Down Expand Up @@ -125,12 +137,16 @@ public Class<?> getOptionType(String name, boolean ignoreCase) {
case "jetstreamName": return java.lang.String.class;
case "lazystartproducer":
case "lazyStartProducer": return boolean.class;
case "maxdeliver":
case "maxDeliver": return long.class;
case "maxmessages":
case "maxMessages": return java.lang.String.class;
case "maxpingsout":
case "maxPingsOut": return int.class;
case "maxreconnectattempts":
case "maxReconnectAttempts": return int.class;
case "nackwait":
case "nackWait": return long.class;
case "noecho":
case "noEcho": return boolean.class;
case "norandomizeservers":
Expand Down Expand Up @@ -170,6 +186,10 @@ public Class<?> getOptionType(String name, boolean ignoreCase) {
public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
NatsEndpoint target = (NatsEndpoint) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "ackpolicy":
case "ackPolicy": return target.getConfiguration().getAckPolicy();
case "ackwait":
case "ackWait": return target.getConfiguration().getAckWait();
case "bridgeerrorhandler":
case "bridgeErrorHandler": return target.isBridgeErrorHandler();
case "connection": return target.getConfiguration().getConnection();
Expand Down Expand Up @@ -199,12 +219,16 @@ public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
case "jetstreamName": return target.getConfiguration().getJetstreamName();
case "lazystartproducer":
case "lazyStartProducer": return target.isLazyStartProducer();
case "maxdeliver":
case "maxDeliver": return target.getConfiguration().getMaxDeliver();
case "maxmessages":
case "maxMessages": return target.getConfiguration().getMaxMessages();
case "maxpingsout":
case "maxPingsOut": return target.getConfiguration().getMaxPingsOut();
case "maxreconnectattempts":
case "maxReconnectAttempts": return target.getConfiguration().getMaxReconnectAttempts();
case "nackwait":
case "nackWait": return target.getConfiguration().getNackWait();
case "noecho":
case "noEcho": return target.getConfiguration().isNoEcho();
case "norandomizeservers":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ public class NatsEndpointUriFactory extends org.apache.camel.support.component.E
private static final Set<String> SECRET_PROPERTY_NAMES;
private static final Map<String, String> MULTI_VALUE_PREFIXES;
static {
Set<String> props = new HashSet<>(37);
Set<String> props = new HashSet<>(41);
props.add("ackPolicy");
props.add("ackWait");
props.add("bridgeErrorHandler");
props.add("connection");
props.add("connectionTimeout");
Expand All @@ -39,9 +41,11 @@ public class NatsEndpointUriFactory extends org.apache.camel.support.component.E
props.add("jetstreamEnabled");
props.add("jetstreamName");
props.add("lazyStartProducer");
props.add("maxDeliver");
props.add("maxMessages");
props.add("maxPingsOut");
props.add("maxReconnectAttempts");
props.add("nackWait");
props.add("noEcho");
props.add("noRandomizeServers");
props.add("pedantic");
Expand Down
Loading
Loading