Member since
06-15-2017
12
Posts
2
Kudos Received
1
Solution
My Accepted Solutions
Title | Views | Posted |
---|---|---|
11663 | 03-06-2018 06:16 AM |
03-06-2018
06:16 AM
I think I have not used Failure Relationship, that's why is showing Error. Because when I create another processor and take only SUCCESS now it is solved.
... View more
03-06-2018
04:45 AM
Hi @Bryan Bende, I have formatted the code please check.
... View more
03-05-2018
09:56 AM
@Tags({"json mapping with entitymaker"})
@CapabilityDescription("Provide a description")
public class MyProcessor extends AbstractProcessor {
public static final Relationship SUCCESS = new Relationship.Builder()
.name("SUCCESS")
.description("Successfully converted incoming json file to EntitymakerJSON")
.build();
public static final Relationship FALIURE = new Relationship.Builder()
.name("FALIURE")
.description("Successfully converted incoming json file to EntitymakerJSON")
.build();
private Set<Relationship> relationships;
@Override
protected void init(final ProcessorInitializationContext context) {
final Set<Relationship> relationships = new HashSet<Relationship>();
relationships.add(SUCCESS);
relationships.add(FALIURE);
this.relationships = Collections.unmodifiableSet(relationships);
}
@Override
public Set<Relationship> getRelationships() {
return relationships;
}
/* public final List<PropertyDescriptor> getSupportedPropertyDescriptors() {
return null ;
}
@OnScheduled
public void onScheduled(final ProcessContext context) {
}*/
@Override
public void onTrigger(final ProcessContext context, final ProcessSession session)
throws ProcessException,FlowFileHandlingException {
final AtomicReference<String> value = new AtomicReference<>();
FlowFile flowFile = session.get();
if ( flowFile == null ) {
return;
}
session.read(flowFile, new InputStreamCallback() {
@Override
public void process(InputStream in) throws IOException {
try{
JSONParser parser = new JSONParser();
JSONArray inputdata;
String json = IOUtils.toString(in);
inputdata = (JSONArray) parser.parse(json);
Jsonmapping jsm = new Jsonmapping();
for (Object o : inputdata)
{
JSONObject person = (JSONObject) o;
JSONObject jo = jsm.finaljson(person);
value.set(jo.toString());
}
}catch(Exception ex){
ex.printStackTrace();
getLogger().error("Failed to read json string.");
}
}
});
flowFile = session.write(flowFile, new OutputStreamCallback() {
@Override
public void process(OutputStream out) throws IOException {
out.write(value.get().getBytes());
}
});
session.transfer(flowFile, SUCCESS);
}
}
... View more
Labels:
- Labels:
-
Apache NiFi
03-03-2018
04:47 AM
1 Kudo
Solved for me when i change to 4096m
... View more
03-02-2018
05:41 AM
1 Kudo
Still i am getting same error after 1024m, When i am converting CSV to JSON
... View more
02-27-2018
11:11 AM
After that any implementation for auto deploying Apache nifi .nar files?
... View more
10-02-2017
06:26 AM
how to do GET calls can you please send me some URL ? This will give only json .. if i want UI . Like through Html i will do rest -call and that processer will show on UI ? That is possible How?i have one more question how to create processer-group through programme ?
... View more
06-15-2017
08:15 PM
i am using Consumepop3 processer in nifi.when i receive any message then its showing eroor:- org.apache.nifi.processor.exception.ProcessException: Failed to receive messages from Email server: [javax.mail.AuthenticationFailedException - EOF on socket
at org.apache.nifi.processors.email.AbstractEmailProcessor.fillMessageQueueIfNecessary(AbstractEmailProcessor.java:328) ~[nifi-email-processors-1.1.2.jar:1.1.2]
at org.apache.nifi.processors.email.AbstractEmailProcessor.receiveMessage(AbstractEmailProcessor.java:387) ~[nifi-email-processors-1.1.2.jar:1.1.2]
at org.apache.nifi.processors.email.AbstractEmailProcessor.onTrigger(AbstractEmailProcessor.java:195) ~[nifi-email-processors-1.1.2.jar:1.1.2]
at org.apache.nifi.processors.email.ConsumePOP3.onTrigger(ConsumePOP3.java:31) ~[nifi-email-processors-1.1.2.jar:1.1.2]
at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27) ~[nifi-api-1.1.2.jar:1.1.2]
at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1099) [nifi-framework-core-1.1.2.jar:1.1.2]
at org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:136) [nifi-framework-core-1.1.2.jar:1.1.2]
at org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:47) [nifi-framework-core-1.1.2.jar:1.1.2]
at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:132) [nifi-framework-core-1.1.2.jar:1.1.2]
at java.util.concurrent.Executors$RunnableAdapFutureTask.java:308) [na:1.8.0_121]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_121]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
Caused by: javax.mail.AuthenticationFailedException: EOF on socket
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:213) ~[mail-1.4.7.jar:1.4.7]
at javax.mail.Service.connect(Service.java:366) ~[mail-1.4.7.jar:1.4.7]
at javax.mail.Service.connect(Service.java:246) ~[mail-1.4.7.jar:1.4.7]
at javax.mail.Service.connect(Service.java:195) ~[mail-1.4.7.jar:1.4.7]
at org.springframework.integration.mail.AbstractMailReceiver.connectStoreIfNecessary(AbstractMailReceiver.java:286) ~[spring-integration-mail-4.3.0.RELEASE.jar:4.3.0.RELEASE]
at org.springframework.integration.mail.AbstractMailReceiver.openFolder(AbstractMailReceiver.java:293) ~[spring-integration-mail-4.3.0.RELEASE.jar:4.3.0.RELEASE]
at org.springframework.integration.mail.AbstractMailReceiver.receive(AbstractMailReceiver.java:319) ~[spring-integration-mail-4.3.0.RELEASE.jar:4.3.0.RELEASE]
at org.apache.nifi.processors.email.AbstractEmailProcessor.fillMessageQueueIfNecessary(AbstractEmailProcessor.java:323) ~[nifi-email-processors-1.1.2.jar:1.1.2]
... 15 common frames omitted Could you please suggest me how to solve this error?
... View more
Labels:
- Labels:
-
Apache NiFi