All docs This doc

Versions Compared

Key

  • 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. 


Panel

@Source(type = 'http',
receiver.url='http://localhost:8006/productionStream',
basic.auth.enabled='false',
@map(type='json'))
define stream SweetProductionStream (name string, amount double);

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

-- Count the incoming events
@info(name='query1')
from SweetProductionStream
select count() as totalCount
insert into TotalCountStream;

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