Method: OCI::Streaming::StreamClient#consumer_commit
- Defined in:
- lib/oci/streaming/stream_client.rb
#consumer_commit(stream_id, cursor, opts = {}) ⇒ Response
Provides a mechanism to manually commit offsets, if not using commit-on-get consumer semantics. This commits offsets assicated with the provided cursor, extends the timeout on each of the affected partitions, and returns an updated cursor.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/oci/streaming/stream_client.rb', line 124 def consumer_commit(stream_id, cursor, opts = {}) logger.debug 'Calling operation StreamClient#consumer_commit.' if logger raise "Missing the required parameter 'stream_id' when calling consumer_commit." if stream_id.nil? raise "Missing the required parameter 'cursor' when calling consumer_commit." if cursor.nil? raise "Parameter value for 'stream_id' must not be blank" if OCI::Internal::Util.blank_string?(stream_id) path = '/streams/{streamId}/commit'.sub('{streamId}', stream_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:cursor] = cursor # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'StreamClient#consumer_commit') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Streaming::Models::Cursor' ) end # rubocop:enable Metrics/BlockLength end |