NIFI-12637 Handle migrating Proxy properties for InvokeHTTP

This closes #8270

Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
Mark Payne 2024-01-18 17:08:38 -05:00 committed by exceptionfactory
parent ddec0dff5a
commit bf1dfd0615
No known key found for this signature in database
1 changed files with 14 additions and 0 deletions

View File

@ -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());