mirror of https://github.com/apache/nifi.git
NIFI-12637 Handle migrating Proxy properties for InvokeHTTP
This closes #8270 Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
parent
ddec0dff5a
commit
bf1dfd0615
|
@ -597,6 +597,20 @@ public class InvokeHTTP extends AbstractProcessor {
|
|||
|
||||
@Override
|
||||
public void migrateProperties(final PropertyConfiguration config) {
|
||||
if (config.isPropertySet("Proxy Host")) {
|
||||
final Map<String, String> serviceProperties = new HashMap<>();
|
||||
serviceProperties.put("proxy-type", config.getRawPropertyValue("Proxy Type").map(String::toUpperCase).orElse(null));
|
||||
serviceProperties.put("proxy-server-host", config.getRawPropertyValue("Proxy Host").orElse(null));
|
||||
serviceProperties.put("proxy-server-port", config.getRawPropertyValue("Proxy Port").orElse(null));
|
||||
serviceProperties.put("proxy-user-name", config.getRawPropertyValue("invokehttp-proxy-user").orElse(null));
|
||||
serviceProperties.put("proxy-user-password", config.getRawPropertyValue("invokehttp-proxy-password").orElse(null));
|
||||
|
||||
final String serviceId = config.createControllerService("org.apache.nifi.proxy.StandardProxyConfigurationService", serviceProperties);
|
||||
config.setProperty(PROXY_CONFIGURATION_SERVICE, serviceId);
|
||||
} else {
|
||||
config.removeProperty("Proxy Type");
|
||||
}
|
||||
|
||||
config.renameProperty("Read Timeout", SOCKET_READ_TIMEOUT.getName());
|
||||
config.renameProperty("Remote URL", HTTP_URL.getName());
|
||||
config.renameProperty("disable-http2", HTTP2_DISABLED.getName());
|
||||
|
|
Loading…
Reference in New Issue