All docs This doc

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


  • LOG : Logs the event with the error, and then drops the event.
  • WAIT : The thread waits in the back-off and re-trying state, and reconnects once the connection is re-established.
  • STREAM: The corresponding fault stream is populated with the failed event and the error that occured while publishing.


e.g.,  The following is a Siddhi application that includes the @OnError annotation to handle publishing error when in-memory source is not available to receive messages. 


@Source(type = 'http',
define stream SweetProductionStream (name string, amount double);

@sink(type='inMemory', topic='count', on.error='stream', @map(type='passThrough'))
define stream TotalCountStream (totalCount long);

-- Count the incoming events
from SweetProductionStream
select count() as totalCount
insert into TotalCountStream;

from !TotalCountStream#log("error stream")
insert into temp;