Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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); }