[
https://issues.apache.org/jira/browse/NIFI-4038?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16064214#comment-16064214
]
ASF GitHub Bot commented on NIFI-4038:
--------------------------------------
Github user trkurc commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1947#discussion_r124173406
--- Diff:
nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/src/main/java/org/apache/nifi/processors/grpc/ListenGRPC.java
---
@@ -0,0 +1,224 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.processors.grpc;
+
+import com.google.common.collect.Sets;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+import org.apache.nifi.annotation.behavior.WritesAttribute;
+import org.apache.nifi.annotation.behavior.WritesAttributes;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.annotation.lifecycle.OnStopped;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.logging.ComponentLog;
+import org.apache.nifi.processor.AbstractSessionFactoryProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSessionFactory;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.apache.nifi.ssl.SSLContextService;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.CertificateException;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.regex.Pattern;
+
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManagerFactory;
+
+import io.grpc.CompressorRegistry;
+import io.grpc.DecompressorRegistry;
+import io.grpc.Server;
+import io.grpc.ServerInterceptors;
+import io.grpc.netty.GrpcSslContexts;
+import io.grpc.netty.NettyServerBuilder;
+import io.netty.handler.ssl.ClientAuth;
+import io.netty.handler.ssl.SslContextBuilder;
+
+@InputRequirement(InputRequirement.Requirement.INPUT_FORBIDDEN)
+@CapabilityDescription("Starts a gRPC server and listens on the given port
to transform the incoming messages into FlowFiles." +
+ " The message format is defined by the standard gRPC protobuf IDL
provided by NiFi.")
+@Tags({"ingest", "grpc", "rpc", "listen"})
+@WritesAttributes({
+ @WritesAttribute(attribute = "listengrpc.remote.user.dn",
description = "The DN of the user who sent the FlowFile to this NiFi"),
+ @WritesAttribute(attribute = "listengrpc.remote.host", description
= "The IP of the client who sent the FlowFile to this NiFi")
+})
+public class ListenGRPC extends AbstractSessionFactoryProcessor {
+ public static final String REMOTE_USER_DN =
"listengrpc.remote.user.dn";
+ public static final String REMOTE_HOST = "listengrpc.remote.host";
+
+ // properties
+ public static final PropertyDescriptor PROP_SERVICE_PORT = new
PropertyDescriptor.Builder()
+ .name("Remote gRPC service port")
--- End diff --
Isn't this a local port?
> Create gRPC server processor
> ----------------------------
>
> Key: NIFI-4038
> URL: https://issues.apache.org/jira/browse/NIFI-4038
> Project: Apache NiFi
> Issue Type: New Feature
> Reporter: Michael Hogue
> Assignee: Michael Hogue
> Priority: Minor
> Attachments: listen_and_invoke_grpc.xml
>
>
> Create a simple gRPC [1] server processor similar to `HandleHttpRequest` that
> listens for RPCs from the gRPC processor created in NIFI-4037.
> [1] http://www.grpc.io/about/
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)