{"id":20578776,"url":"https://github.com/cclient/nifi-email-bundle","last_synced_at":"2025-10-19T14:07:14.167Z","repository":{"id":93977419,"uuid":"343073840","full_name":"cclient/nifi-email-bundle","owner":"cclient","description":"nifi练习项目，聚合多flowfile的attribute，以单个邮件发放通知","archived":false,"fork":false,"pushed_at":"2021-02-28T13:10:53.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-16T22:20:02.626Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.cnblogs.com/zihunqingxin/p/14459954.html","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cclient.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-28T10:11:58.000Z","updated_at":"2023-07-11T08:47:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"985d75d5-da02-4c0c-a7e6-50e5a03e5f98","html_url":"https://github.com/cclient/nifi-email-bundle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cclient%2Fnifi-email-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cclient%2Fnifi-email-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cclient%2Fnifi-email-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cclient%2Fnifi-email-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cclient","download_url":"https://codeload.github.com/cclient/nifi-email-bundle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242205990,"owners_count":20089251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T06:14:31.323Z","updated_at":"2025-10-19T14:07:14.118Z","avatar_url":"https://github.com/cclient.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Nifi SendEmail Processor\n================================\n\n```orginal\n\nflowfile0                 mail0(flowfile0)\n\nflowfile1  PutMail(1:1)   mail1(flowfile1)\n\nflowfile2                 mail2(flowfile2)\n\n```\n\n```this\n\nflowfile0            \n\nflowfile1  SendMail(n:1)  mail(flowfile0,flowfile1,flowfile2)\n\nflowfile2           \n\n\n```\n\n### 需求\n\n* nifi生态和自定义processor下通常有failure stream的处理,为了及时发现failure需统一发送通知邮件\n\n* upstream 里会堆积多项flowfile,1:1发送邮件则通知过多，因此n:1 把多项flowfile合并在一个邮件里发送(只发送flowfile的attribute信息)\n\n* 邮件内容为table,每列是一个attribute,attribule取并集，每行是一个flowfile的所有attribute\n\n基于官方的[PutMail](https://github.com/apache/nifi/blob/a9db5a8cb7313005b4077b66ce10ef81d3055ee8/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutEmail.java) 开发\n\n可以组合多个官方processor实现该功能，例如在前置Processor完成拼接email msg内容，直接通过putMail发送邮件\n\n通过简单定制实现也是为了熟悉nifi的开发/测试规范\n\n邮件为html body如下\n\n\u003ctable border=\"1\"\u003e\n    \u003cthead align=\"center\" valign=\"middle\"\u003e\n    \u003ctr\u003e\n        \u003cth\u003ea0\u003c/th\u003e\n        \u003cth\u003ea1\u003c/th\u003e\n        \u003cth\u003ea2\u003c/th\u003e\n        \u003cth\u003ea3\u003c/th\u003e\n        \u003cth\u003efilename\u003c/th\u003e\n        \u003cth\u003epath\u003c/th\u003e\n        \u003cth\u003euuid\u003c/th\u003e\n        \u003cth\u003eentryDate\u003c/th\u003e\n        \u003cth\u003esize\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n    \u003ctr\u003e\n        \u003ctd\u003ev0\u003c/td\u003e\n        \u003ctd\u003ev1\u003c/td\u003e\n        \u003ctd\u003ev2\u003c/td\u003e\n        \u003ctd\u003ev3\u003c/td\u003e\n        \u003ctd\u003e184775642434972.mockFlowFile\u003c/td\u003e\n        \u003ctd\u003etarget\u003c/td\u003e\n        \u003ctd\u003e1bdaef1f-960b-48c5-a739-a881f92d1466\u003c/td\u003e\n        \u003ctd\u003eThu May 21 15:37:00 CST 2020\u003c/td\u003e\n        \u003ctd\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003ev0\u003c/td\u003e\n        \u003ctd\u003ev1\u003c/td\u003e\n        \u003ctd\u003ev2\u003c/td\u003e\n        \u003ctd\u003ev3\u003c/td\u003e\n        \u003ctd\u003e184323287499017.mockFlowFile\u003c/td\u003e\n        \u003ctd\u003etarget\u003c/td\u003e\n        \u003ctd\u003e45caab10-50c4-4727-ac42-bc345670cf85\u003c/td\u003e\n        \u003ctd\u003eThu May 21 15:37:00 CST 2020\u003c/td\u003e\n        \u003ctd\u003eThu Jan 01 08:00:00 CST 1970\u003c/td\u003e\n    \u003c/tr\u003e    \n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n\n### deploy\n\n#### 1 compile\n\n`mvn package -Dmaven.test.skip=true`\n\n#### 2 upload to one of\n\n```nifi\n\nnifi.nar.library.directory=./lib\nnifi.nar.library.directory.custom=./lib_custom\nnifi.nar.library.autoload.directory=./extensions\nnifi.nar.working.directory=./work/nar/\n\n```\n\ncp nifi-email-nar/target/nifi-email-nar-0.1.nar nifi/lib_custom/\n\n#### 3 restart nifi if need\n\nnifi/bin/nifi.sh restart\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcclient%2Fnifi-email-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcclient%2Fnifi-email-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcclient%2Fnifi-email-bundle/lists"}