Description
Following documentation I should be able to create a processor with @ElementListener:
I tried this:
public class RestOutput implements Serializable {
private final RequestConfig config; private final RestService client; private transient List<Record> records;
public RestOutput(@Option("configuration") final RequestConfig config, final RestService client) {
this.config = config; this.client = client; }
@AfterGroup public void afterGroup(final Collection<Record> records) throws SQLException {
for (Record record : records) {
Record result = client.execute(config, record); }
}
}
But I have this error when I try to start pipeline designer :
Suppressed: java.lang.IllegalArgumentException: No @ElementListener method in class org.talend.components.rest.output.RestOutput at org.talend.sdk.component.design.extension.flows.ProcessorFlowsFactory.lambda$getListener$8(ProcessorFlowsFactory.java:81) at java.util.Optional.orElseThrow( Optional.java:290) at org.talend.sdk.component.design.extension.flows.ProcessorFlowsFactory.getListener(ProcessorFlowsFactory.java:81) at org.talend.sdk.component.design.extension.flows.ProcessorFlowsFactory.getListenerParameters(ProcessorFlowsFactory.java:91) at org.talend.sdk.component.design.extension.flows.ProcessorFlowsFactory.getInputFlows(ProcessorFlowsFactory.java:49) at org.talend.sdk.component.design.extension.DesignContainerListener.lambda$null$3(DesignContainerListener.java:79) at java.util.Optional.orElseGet(Optional.java:267) at org.talend.sdk.component.design.extension.DesignContainerListener.lambda$onCreate$4(DesignContainerListener.java:77) at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1625) at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743) at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:270) at java.util.concurrent.ConcurrentHashMap$ValueSpliterator.forEachRemaining( ConcurrentHashMap.java:3566) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto( AbstractPipeline.java:471) at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) at org.talend.sdk.component.design.extension.DesignContainerListener.onCreate( DesignContainerListener.java:69) at org.talend.sdk.component.container.ContainerManager$ContainerBuilder.lambda$null$2(ContainerManager.java:411) at org.talend.sdk.component.container.ContainerManager.safeInvoke(ContainerManager.java:157) at org.talend.sdk.component.container.ContainerManager.access$1000( ContainerManager.java:63) at org.talend.sdk.component.container.ContainerManager$ContainerBuilder.lambda$create$3(ContainerManager.java:411) at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174) at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) at org.talend.sdk.component.container.ContainerManager$ContainerBuilder.create( ContainerManager.java:412) ... 69 more