Skip to content

Commit

Permalink
camel-knative: fix configurers
Browse files Browse the repository at this point in the history
  • Loading branch information
lburgazzoli committed Sep 21, 2020
1 parent 176cbfb commit afd3847
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ public boolean configure(CamelContext camelContext, Object obj, String name, Obj
case "serviceName": getOrCreateConfiguration(target).setServiceName(property(camelContext, java.lang.String.class, value)); return true;
case "transport": target.setTransport(property(camelContext, org.apache.camel.component.knative.spi.KnativeTransport.class, value)); return true;
case "transportoptions":
case "transportOptions": target.setTransportOptions(property(camelContext, java.util.Map.class, value)); return true;
case "transportoptions":
case "transportOptions": getOrCreateConfiguration(target).setTransportOptions(property(camelContext, java.util.Map.class, value)); return true;
default: return false;
}
Expand All @@ -80,7 +78,6 @@ public Map<String, Object> getAllOptions(Object target) {
answer.put("serviceName", java.lang.String.class);
answer.put("transport", org.apache.camel.component.knative.spi.KnativeTransport.class);
answer.put("transportOptions", java.util.Map.class);
answer.put("transportOptions", java.util.Map.class);
return answer;
}

Expand Down Expand Up @@ -115,8 +112,6 @@ public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
case "serviceName": return getOrCreateConfiguration(target).getServiceName();
case "transport": return target.getTransport();
case "transportoptions":
case "transportOptions": return target.getTransportOptions();
case "transportoptions":
case "transportOptions": return getOrCreateConfiguration(target).getTransportOptions();
default: return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ public class KnativeComponent extends DefaultComponent {
@Metadata
private KnativeTransport transport;

@Metadata
private Map<String, Object> transportOptions;

private boolean managedTransport;

public KnativeComponent() {
Expand Down Expand Up @@ -172,8 +169,8 @@ protected void doInit() throws Exception {
.newInstance(protocol.name(), KnativeTransport.class)
.orElseThrow(() -> new RuntimeException("Error creating knative transport for protocol: " + protocol.name()));

if (transportOptions != null) {
setProperties(transport, new HashMap<>(transportOptions));
if (configuration.getTransportOptions() != null) {
setProperties(transport, new HashMap<>(configuration.getTransportOptions()));
}

this.managedTransport = true;
Expand Down

0 comments on commit afd3847

Please sign in to comment.