Nifi 定制处理器无响应,不显示任何问题

Nifi customized processor do not response and do not show any probleme

我正在使用 Nifi,我正在尝试创建一个 Apache Nifi 处理器,但它没有反应!处理器已构建,它显示在处理器列表中并且可以工作但没有任何输入!它没有显示任何内容。
这是我的代码:

    @Override
    public void onTrigger(final ProcessContext context, final ProcessSession session) throws ProcessException {

        final AtomicReference<String> value = new AtomicReference<>();    
        Integer Somme=new Integer(1254+5520);

         FlowFile flowFile = session.get();
         session.read(flowFile, new InputStreamCallback() {
             @Override
             public void process(InputStream in) throws IOException {
                 HttpGet request = new HttpGet(URL);

                 HttpHost target = new HttpHost(localhost, 8080, "http");
                 CredentialsProvider provider = new BasicCredentialsProvider();
                 provider.setCredentials(
                         new AuthScope(target.getHostName(), target.getPort()),
                         new UsernamePasswordCredentials(Username, paswd)
                 );

                 AuthCache authCache = new BasicAuthCache();
                 authCache.put(target, new BasicScheme());

                 HttpClientContext localContext = HttpClientContext.create();
                 localContext.setAuthCache(authCache);

                 try (CloseableHttpClient httpClient = HttpClientBuilder.create()
                         .setDefaultCredentialsProvider(provider)
                         .build();
                      CloseableHttpResponse response = httpClient.execute(target, request, localContext)) {

                     // 401 if wrong user/password
                     System.out.println(response.getStatusLine().getStatusCode());

                     HttpEntity entity = response.getEntity();
                     if (entity != null) {
                         // return it as a String
                         String result = EntityUtils.toString(entity);
                         System.out.println(result.getBytes());
                         value.set(result);
                     }

                 }

             }
         });

      // Write the results to an attribute
         String results = value.get();
         if(results != null && !results.isEmpty()){
             flowFile = session.putAttribute(flowFile, "match", results);
         }

         // To write the results back out ot flow file
         flowFile = session.write(flowFile, new OutputStreamCallback() {

             @Override
             public void process(OutputStream out) throws IOException {
                 out.write(value.get().getBytes());
             }
         });

         session.transfer(flowFile, Success);

    }

}

请帮忙!已经好几天了,似乎什么都不对:(

当实现源处理器(意味着没有输入)时,您想要使用 session.create() 来创建一个全新的流文件。使用 session.get() 将尝试从传入队列中获取流文件,但由于有 none,它将始终为空。