lib/logstash/outputs/analyticdb.rb in logstash-output-analyticdb-5.4.0.9 vs lib/logstash/outputs/analyticdb.rb in logstash-output-analyticdb-5.4.0.10

- old
+ new

@@ -106,10 +106,12 @@ # The magic key used to convert the whole event to JSON. If you need this, and you have the default in your events, you can use this to change your magic keyword. config :event_as_json_keyword, validate: :string, default: '@event' config :commit_size, validate: :number, default: 32768 + config :skip_exception, validate: :boolean, default: false + def register @logger.info('JDBC - Starting up') load_jar_files! @@ -305,10 +307,13 @@ if @max_flush_exceptions > 0 and count_as_attempt == true attempts += 1 if attempts > @max_flush_exceptions - @logger.error("JDBC - max_flush_exceptions has been reached. #{submit_actions.length} events have been unable to be sent to SQL and are being dropped. See previously logged exceptions for details.") + if (@skip_exception) + @logger.error("JDBC - max_flush_exceptions has been reached. #{submit_actions.length} events have been unable to be sent to SQL and are being skipped. See previously logged exceptions for details.") + break + end raise "JDBC - max_flush_exceptions #{max_flush_exceptions} has been reached. #{submit_actions.length} events have been unable to be sent to SQL and are being dropped. See previously logged exceptions for details." break end end