Component Kit - Output record

Highlighted
Five Stars

Component Kit - Output record

Hi all,

I'm writing a custom component using the Component Toolkit targeting 7.x of TOS. I want to be able to pass through the messageid that its returned from AWS to downstream components (tLogRow in this instance).

 

I have the inputs setup and whilst debugging can see the messageId set (as output to the console via System.out) however I'm unable to see it in the tLogRow. I'm assuming it's something to do with how the record is setup but I'm not getting any errors either.

 

I did initially setup the project using the starter kit and selecting Processor but manually added in the @Output final OutputEmitter defaultOutput code. 

 

@ElementListener
    public void onNext(
            @Input final Record defaultInput,
            @Output final OutputEmitter<Record> defaultOutput){
        System.out.println("xxx["+configuration.getLevel().toUpperCase()+"] "+defaultInput);

        final AmazonSNS snsClient = AmazonSNSClientBuilder.defaultClient();

        String publishMessage = "json_payload_xxxx";

        final String arn = "secret";

        final PublishRequest publishRequest = new PublishRequest(arn, publishMessage);

        publishRequest.setSubject("subj");
        publishRequest.setMessageStructure("json");

        final PublishResult publishResponse = snsClient.publish(publishRequest);

        String messageId = publishResponse.getMessageId();

        Record record = recordBuilderFactory.newRecordBuilder().withString("messageId", messageId).build();


        System.out.println(record.getString("messageId"));
        // Print the MessageId of the message.

        defaultOutput.emit(record);
    }
Highlighted
Employee

Re: Component Kit - Output record

Hi @serdarkilic,

Did you ensure all components have a schema set up?
You can need to hit "guess schema" button to do it.

Romain
Talend Component Kit Documentation: https://talend.github.io/component-runtime/

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog

Downloads and Trials

Test drive Talend's enterprise products.

Downloads