Apama Documentation : Connecting Apama Applications to External Components : Using Standard Adapters : Using Adapter Plug-ins : The CSV codec plug-in : Encoding CSV data from the correlator for the sink
Encoding CSV data from the correlator for the sink
Encoding CSV data works in the exact opposite way as decoding. The semantic mapper calls:
public void sendNormalisedEvent(NormalisedEvent event,
                                TimestampSet timestamps)
    throws CodecException, TransportException
The sendNormalisedEvent()method retrieves the data associated with the data key. The retrieved data is a sequence of strings, each of which contains the value of a field. The method then encodes the sequence into a single line to send to the transport so the transport can write the data to the sink. The CSV codec stores the result of the encoding in the data field. If the event contains a sessionId value, this is the configuration that the codec uses to encode the data. If the event does not contain a sessionId, the codec uses the default adapter configuration as specified in the adapter's configuration file initially used to start the adapter.
For a given event mapping in the IAF configuration file, it is not possible to dynamically specify the event decoder property, which identifies the codec that sends this event to the transport. Consequently, an adapter that is using several different codecs is unable to receive the same type of event from each codec. If it is necessary for your adapter to receive the same type of event from multiple codecs, set the event decoder property to the Null codec. This lets the transport receive the event and subsequently reroute the event back to the CSV codec by calling the following method:
sendNormalisedEvent(NormalisedEvent event, TimestampSet timestamps)
The CSV codec then returns the encoded data to the transport.
Copyright © 2013-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback