Module: NATS::JetStream::API

Defined in:
lib/nats/io/js.rb

Overview

JetStream::API are the types used to interact with the JetStream API.

Defined Under Namespace

Classes: ConsumerConfig, ConsumerInfo, RawStreamMsg, SequenceInfo, StreamConfig, StreamCreateResponse, StreamInfo, StreamState

Constant Summary collapse

Error =

When the server responds with an error from the JetStream API.

::NATS::JetStream::Error::APIError

Instance Attribute Summary collapse

Instance Attribute Details

#ack_floorSequenceInfo

Returns:



1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
# File 'lib/nats/io/js.rb', line 1183

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#ack_policyString

Returns:

  • (String)


1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
# File 'lib/nats/io/js.rb', line 1221

ConsumerConfig = Struct.new(:name, :durable_name, :description,
                            :deliver_policy, :opt_start_seq, :opt_start_time,
                            :ack_policy, :ack_wait, :max_deliver, :backoff,
                            :filter_subject, :replay_policy, :rate_limit_bps,
                            :sample_freq, :max_waiting, :max_ack_pending,
                            :flow_control, :idle_heartbeat, :headers_only,

                            # Pull based options
                            :max_batch, :max_expires,
                            # Push based consumers
                            :deliver_subject, :deliver_group,
                            # Ephemeral inactivity threshold
                            :inactive_threshold,
                            # Generally inherited by parent stream and other markers,
                            # now can be configured directly.
                            :num_replicas,
                            # Force memory storage
                            :mem_storage,
                            keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#ack_waitInteger

Returns:

  • (Integer)


1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
# File 'lib/nats/io/js.rb', line 1221

ConsumerConfig = Struct.new(:name, :durable_name, :description,
                            :deliver_policy, :opt_start_seq, :opt_start_time,
                            :ack_policy, :ack_wait, :max_deliver, :backoff,
                            :filter_subject, :replay_policy, :rate_limit_bps,
                            :sample_freq, :max_waiting, :max_ack_pending,
                            :flow_control, :idle_heartbeat, :headers_only,

                            # Pull based options
                            :max_batch, :max_expires,
                            # Push based consumers
                            :deliver_subject, :deliver_group,
                            # Ephemeral inactivity threshold
                            :inactive_threshold,
                            # Generally inherited by parent stream and other markers,
                            # now can be configured directly.
                            :num_replicas,
                            # Force memory storage
                            :mem_storage,
                            keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#bytesInteger

Returns:

  • (Integer)


1372
1373
1374
1375
1376
1377
1378
1379
1380
# File 'lib/nats/io/js.rb', line 1372

StreamState = Struct.new(:messages, :bytes, :first_seq, :first_ts,
                         :last_seq, :last_ts, :consumer_count,
                         keyword_init: true) do
  def initialize(opts={})
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end
end

#clusterHash

Returns:

  • (Hash)


1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
# File 'lib/nats/io/js.rb', line 1183

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#configHash

Returns:

  • (Hash)


1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
# File 'lib/nats/io/js.rb', line 1183

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#consumer_countInteger

Returns:

  • (Integer)


1372
1373
1374
1375
1376
1377
1378
1379
1380
# File 'lib/nats/io/js.rb', line 1372

StreamState = Struct.new(:messages, :bytes, :first_seq, :first_ts,
                         :last_seq, :last_ts, :consumer_count,
                         keyword_init: true) do
  def initialize(opts={})
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end
end

#consumer_seqInteger

Returns The consumer sequence.

Returns:

  • (Integer)

    The consumer sequence.



1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
# File 'lib/nats/io/js.rb', line 1148

SequenceInfo = Struct.new(:consumer_seq, :stream_seq, :last_active,
                          keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields and freeze.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#createdString

Returns:

  • (String)


1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
# File 'lib/nats/io/js.rb', line 1183

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#deliver_policyString

Returns:

  • (String)


1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
# File 'lib/nats/io/js.rb', line 1221

ConsumerConfig = Struct.new(:name, :durable_name, :description,
                            :deliver_policy, :opt_start_seq, :opt_start_time,
                            :ack_policy, :ack_wait, :max_deliver, :backoff,
                            :filter_subject, :replay_policy, :rate_limit_bps,
                            :sample_freq, :max_waiting, :max_ack_pending,
                            :flow_control, :idle_heartbeat, :headers_only,

                            # Pull based options
                            :max_batch, :max_expires,
                            # Push based consumers
                            :deliver_subject, :deliver_group,
                            # Ephemeral inactivity threshold
                            :inactive_threshold,
                            # Generally inherited by parent stream and other markers,
                            # now can be configured directly.
                            :num_replicas,
                            # Force memory storage
                            :mem_storage,
                            keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#deliveredSequenceInfo

Returns:



1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
# File 'lib/nats/io/js.rb', line 1183

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#did_createBoolean

Returns:

  • (Boolean)


1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
# File 'lib/nats/io/js.rb', line 1292

StreamConfig = Struct.new(
                          :name,
                          :description,
                          :subjects,
                          :retention,
                          :max_consumers,
                          :max_msgs,
                          :max_bytes,
                          :discard,
                          :max_age,
                          :max_msgs_per_subject,
                          :max_msg_size,
                          :storage,
                          :num_replicas,
                          :no_ack,
                          :duplicate_window,
                          :placement,
                          :mirror,
                          :sources,
                          :sealed,
                          :deny_delete,
                          :deny_purge,
                          :allow_rollup_hdrs,
                          :republish,
                          :allow_direct,
                          :mirror_direct,
                          keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#discardString

Returns:

  • (String)


1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
# File 'lib/nats/io/js.rb', line 1292

StreamConfig = Struct.new(
                          :name,
                          :description,
                          :subjects,
                          :retention,
                          :max_consumers,
                          :max_msgs,
                          :max_bytes,
                          :discard,
                          :max_age,
                          :max_msgs_per_subject,
                          :max_msg_size,
                          :storage,
                          :num_replicas,
                          :no_ack,
                          :duplicate_window,
                          :placement,
                          :mirror,
                          :sources,
                          :sealed,
                          :deny_delete,
                          :deny_purge,
                          :allow_rollup_hdrs,
                          :republish,
                          :allow_direct,
                          :mirror_direct,
                          keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#duplicate_windowInteger

Returns:

  • (Integer)


1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
# File 'lib/nats/io/js.rb', line 1292

StreamConfig = Struct.new(
                          :name,
                          :description,
                          :subjects,
                          :retention,
                          :max_consumers,
                          :max_msgs,
                          :max_bytes,
                          :discard,
                          :max_age,
                          :max_msgs_per_subject,
                          :max_msg_size,
                          :storage,
                          :num_replicas,
                          :no_ack,
                          :duplicate_window,
                          :placement,
                          :mirror,
                          :sources,
                          :sealed,
                          :deny_delete,
                          :deny_purge,
                          :allow_rollup_hdrs,
                          :republish,
                          :allow_direct,
                          :mirror_direct,
                          keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#durable_nameString

Returns:

  • (String)


1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
# File 'lib/nats/io/js.rb', line 1221

ConsumerConfig = Struct.new(:name, :durable_name, :description,
                            :deliver_policy, :opt_start_seq, :opt_start_time,
                            :ack_policy, :ack_wait, :max_deliver, :backoff,
                            :filter_subject, :replay_policy, :rate_limit_bps,
                            :sample_freq, :max_waiting, :max_ack_pending,
                            :flow_control, :idle_heartbeat, :headers_only,

                            # Pull based options
                            :max_batch, :max_expires,
                            # Push based consumers
                            :deliver_subject, :deliver_group,
                            # Ephemeral inactivity threshold
                            :inactive_threshold,
                            # Generally inherited by parent stream and other markers,
                            # now can be configured directly.
                            :num_replicas,
                            # Force memory storage
                            :mem_storage,
                            keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#first_seqInteger

Returns:

  • (Integer)


1372
1373
1374
1375
1376
1377
1378
1379
1380
# File 'lib/nats/io/js.rb', line 1372

StreamState = Struct.new(:messages, :bytes, :first_seq, :first_ts,
                         :last_seq, :last_ts, :consumer_count,
                         keyword_init: true) do
  def initialize(opts={})
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end
end

#last_seqInteger

Returns:

  • (Integer)


1372
1373
1374
1375
1376
1377
1378
1379
1380
# File 'lib/nats/io/js.rb', line 1372

StreamState = Struct.new(:messages, :bytes, :first_seq, :first_ts,
                         :last_seq, :last_ts, :consumer_count,
                         keyword_init: true) do
  def initialize(opts={})
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end
end

#max_ack_pendingInteger

Returns:

  • (Integer)


1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
# File 'lib/nats/io/js.rb', line 1221

ConsumerConfig = Struct.new(:name, :durable_name, :description,
                            :deliver_policy, :opt_start_seq, :opt_start_time,
                            :ack_policy, :ack_wait, :max_deliver, :backoff,
                            :filter_subject, :replay_policy, :rate_limit_bps,
                            :sample_freq, :max_waiting, :max_ack_pending,
                            :flow_control, :idle_heartbeat, :headers_only,

                            # Pull based options
                            :max_batch, :max_expires,
                            # Push based consumers
                            :deliver_subject, :deliver_group,
                            # Ephemeral inactivity threshold
                            :inactive_threshold,
                            # Generally inherited by parent stream and other markers,
                            # now can be configured directly.
                            :num_replicas,
                            # Force memory storage
                            :mem_storage,
                            keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#max_ageInteger

Returns:

  • (Integer)


1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
# File 'lib/nats/io/js.rb', line 1292

StreamConfig = Struct.new(
                          :name,
                          :description,
                          :subjects,
                          :retention,
                          :max_consumers,
                          :max_msgs,
                          :max_bytes,
                          :discard,
                          :max_age,
                          :max_msgs_per_subject,
                          :max_msg_size,
                          :storage,
                          :num_replicas,
                          :no_ack,
                          :duplicate_window,
                          :placement,
                          :mirror,
                          :sources,
                          :sealed,
                          :deny_delete,
                          :deny_purge,
                          :allow_rollup_hdrs,
                          :republish,
                          :allow_direct,
                          :mirror_direct,
                          keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#max_bytesInteger

Returns:

  • (Integer)


1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
# File 'lib/nats/io/js.rb', line 1292

StreamConfig = Struct.new(
                          :name,
                          :description,
                          :subjects,
                          :retention,
                          :max_consumers,
                          :max_msgs,
                          :max_bytes,
                          :discard,
                          :max_age,
                          :max_msgs_per_subject,
                          :max_msg_size,
                          :storage,
                          :num_replicas,
                          :no_ack,
                          :duplicate_window,
                          :placement,
                          :mirror,
                          :sources,
                          :sealed,
                          :deny_delete,
                          :deny_purge,
                          :allow_rollup_hdrs,
                          :republish,
                          :allow_direct,
                          :mirror_direct,
                          keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#max_consumersInteger

Returns:

  • (Integer)


1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
# File 'lib/nats/io/js.rb', line 1292

StreamConfig = Struct.new(
                          :name,
                          :description,
                          :subjects,
                          :retention,
                          :max_consumers,
                          :max_msgs,
                          :max_bytes,
                          :discard,
                          :max_age,
                          :max_msgs_per_subject,
                          :max_msg_size,
                          :storage,
                          :num_replicas,
                          :no_ack,
                          :duplicate_window,
                          :placement,
                          :mirror,
                          :sources,
                          :sealed,
                          :deny_delete,
                          :deny_purge,
                          :allow_rollup_hdrs,
                          :republish,
                          :allow_direct,
                          :mirror_direct,
                          keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#max_deliverInteger

Returns:

  • (Integer)


1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
# File 'lib/nats/io/js.rb', line 1221

ConsumerConfig = Struct.new(:name, :durable_name, :description,
                            :deliver_policy, :opt_start_seq, :opt_start_time,
                            :ack_policy, :ack_wait, :max_deliver, :backoff,
                            :filter_subject, :replay_policy, :rate_limit_bps,
                            :sample_freq, :max_waiting, :max_ack_pending,
                            :flow_control, :idle_heartbeat, :headers_only,

                            # Pull based options
                            :max_batch, :max_expires,
                            # Push based consumers
                            :deliver_subject, :deliver_group,
                            # Ephemeral inactivity threshold
                            :inactive_threshold,
                            # Generally inherited by parent stream and other markers,
                            # now can be configured directly.
                            :num_replicas,
                            # Force memory storage
                            :mem_storage,
                            keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#max_msg_sizeInteger

Returns:

  • (Integer)


1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
# File 'lib/nats/io/js.rb', line 1292

StreamConfig = Struct.new(
                          :name,
                          :description,
                          :subjects,
                          :retention,
                          :max_consumers,
                          :max_msgs,
                          :max_bytes,
                          :discard,
                          :max_age,
                          :max_msgs_per_subject,
                          :max_msg_size,
                          :storage,
                          :num_replicas,
                          :no_ack,
                          :duplicate_window,
                          :placement,
                          :mirror,
                          :sources,
                          :sealed,
                          :deny_delete,
                          :deny_purge,
                          :allow_rollup_hdrs,
                          :republish,
                          :allow_direct,
                          :mirror_direct,
                          keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#max_msgsInteger

Returns:

  • (Integer)


1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
# File 'lib/nats/io/js.rb', line 1292

StreamConfig = Struct.new(
                          :name,
                          :description,
                          :subjects,
                          :retention,
                          :max_consumers,
                          :max_msgs,
                          :max_bytes,
                          :discard,
                          :max_age,
                          :max_msgs_per_subject,
                          :max_msg_size,
                          :storage,
                          :num_replicas,
                          :no_ack,
                          :duplicate_window,
                          :placement,
                          :mirror,
                          :sources,
                          :sealed,
                          :deny_delete,
                          :deny_purge,
                          :allow_rollup_hdrs,
                          :republish,
                          :allow_direct,
                          :mirror_direct,
                          keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#max_msgs_per_subjectInteger

Returns:

  • (Integer)


1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
# File 'lib/nats/io/js.rb', line 1292

StreamConfig = Struct.new(
                          :name,
                          :description,
                          :subjects,
                          :retention,
                          :max_consumers,
                          :max_msgs,
                          :max_bytes,
                          :discard,
                          :max_age,
                          :max_msgs_per_subject,
                          :max_msg_size,
                          :storage,
                          :num_replicas,
                          :no_ack,
                          :duplicate_window,
                          :placement,
                          :mirror,
                          :sources,
                          :sealed,
                          :deny_delete,
                          :deny_purge,
                          :allow_rollup_hdrs,
                          :republish,
                          :allow_direct,
                          :mirror_direct,
                          keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#max_waitingInteger

Returns:

  • (Integer)


1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
# File 'lib/nats/io/js.rb', line 1221

ConsumerConfig = Struct.new(:name, :durable_name, :description,
                            :deliver_policy, :opt_start_seq, :opt_start_time,
                            :ack_policy, :ack_wait, :max_deliver, :backoff,
                            :filter_subject, :replay_policy, :rate_limit_bps,
                            :sample_freq, :max_waiting, :max_ack_pending,
                            :flow_control, :idle_heartbeat, :headers_only,

                            # Pull based options
                            :max_batch, :max_expires,
                            # Push based consumers
                            :deliver_subject, :deliver_group,
                            # Ephemeral inactivity threshold
                            :inactive_threshold,
                            # Generally inherited by parent stream and other markers,
                            # now can be configured directly.
                            :num_replicas,
                            # Force memory storage
                            :mem_storage,
                            keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#messagesInteger

Returns:

  • (Integer)


1372
1373
1374
1375
1376
1377
1378
1379
1380
# File 'lib/nats/io/js.rb', line 1372

StreamState = Struct.new(:messages, :bytes, :first_seq, :first_ts,
                         :last_seq, :last_ts, :consumer_count,
                         keyword_init: true) do
  def initialize(opts={})
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end
end

#nameString

Returns:

  • (String)


1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
# File 'lib/nats/io/js.rb', line 1183

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#num_ack_pendingInteger

Returns:

  • (Integer)


1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
# File 'lib/nats/io/js.rb', line 1183

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#num_pendingInteger

Returns:

  • (Integer)


1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
# File 'lib/nats/io/js.rb', line 1183

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#num_redeliveredInteger

Returns:

  • (Integer)


1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
# File 'lib/nats/io/js.rb', line 1183

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#num_replicasInteger

Returns:

  • (Integer)


1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
# File 'lib/nats/io/js.rb', line 1292

StreamConfig = Struct.new(
                          :name,
                          :description,
                          :subjects,
                          :retention,
                          :max_consumers,
                          :max_msgs,
                          :max_bytes,
                          :discard,
                          :max_age,
                          :max_msgs_per_subject,
                          :max_msg_size,
                          :storage,
                          :num_replicas,
                          :no_ack,
                          :duplicate_window,
                          :placement,
                          :mirror,
                          :sources,
                          :sealed,
                          :deny_delete,
                          :deny_purge,
                          :allow_rollup_hdrs,
                          :republish,
                          :allow_direct,
                          :mirror_direct,
                          keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#num_waitingInteger

Returns:

  • (Integer)


1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
# File 'lib/nats/io/js.rb', line 1183

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#replay_policyString

Returns:

  • (String)


1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
# File 'lib/nats/io/js.rb', line 1221

ConsumerConfig = Struct.new(:name, :durable_name, :description,
                            :deliver_policy, :opt_start_seq, :opt_start_time,
                            :ack_policy, :ack_wait, :max_deliver, :backoff,
                            :filter_subject, :replay_policy, :rate_limit_bps,
                            :sample_freq, :max_waiting, :max_ack_pending,
                            :flow_control, :idle_heartbeat, :headers_only,

                            # Pull based options
                            :max_batch, :max_expires,
                            # Push based consumers
                            :deliver_subject, :deliver_group,
                            # Ephemeral inactivity threshold
                            :inactive_threshold,
                            # Generally inherited by parent stream and other markers,
                            # now can be configured directly.
                            :num_replicas,
                            # Force memory storage
                            :mem_storage,
                            keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#retentionString

Returns:

  • (String)


1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
# File 'lib/nats/io/js.rb', line 1292

StreamConfig = Struct.new(
                          :name,
                          :description,
                          :subjects,
                          :retention,
                          :max_consumers,
                          :max_msgs,
                          :max_bytes,
                          :discard,
                          :max_age,
                          :max_msgs_per_subject,
                          :max_msg_size,
                          :storage,
                          :num_replicas,
                          :no_ack,
                          :duplicate_window,
                          :placement,
                          :mirror,
                          :sources,
                          :sealed,
                          :deny_delete,
                          :deny_purge,
                          :allow_rollup_hdrs,
                          :republish,
                          :allow_direct,
                          :mirror_direct,
                          keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#stateStreamState

Returns:



1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
# File 'lib/nats/io/js.rb', line 1292

StreamConfig = Struct.new(
                          :name,
                          :description,
                          :subjects,
                          :retention,
                          :max_consumers,
                          :max_msgs,
                          :max_bytes,
                          :discard,
                          :max_age,
                          :max_msgs_per_subject,
                          :max_msg_size,
                          :storage,
                          :num_replicas,
                          :no_ack,
                          :duplicate_window,
                          :placement,
                          :mirror,
                          :sources,
                          :sealed,
                          :deny_delete,
                          :deny_purge,
                          :allow_rollup_hdrs,
                          :republish,
                          :allow_direct,
                          :mirror_direct,
                          keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#storageString

Returns:

  • (String)


1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
# File 'lib/nats/io/js.rb', line 1292

StreamConfig = Struct.new(
                          :name,
                          :description,
                          :subjects,
                          :retention,
                          :max_consumers,
                          :max_msgs,
                          :max_bytes,
                          :discard,
                          :max_age,
                          :max_msgs_per_subject,
                          :max_msg_size,
                          :storage,
                          :num_replicas,
                          :no_ack,
                          :duplicate_window,
                          :placement,
                          :mirror,
                          :sources,
                          :sealed,
                          :deny_delete,
                          :deny_purge,
                          :allow_rollup_hdrs,
                          :republish,
                          :allow_direct,
                          :mirror_direct,
                          keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#stream_nameString

Returns name of the stream to which the consumer belongs.

Returns:

  • (String)

    name of the stream to which the consumer belongs.



1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
# File 'lib/nats/io/js.rb', line 1183

ConsumerInfo = Struct.new(:type, :stream_name, :name, :created,
                          :config, :delivered, :ack_floor,
                          :num_ack_pending, :num_redelivered, :num_waiting,
                          :num_pending, :cluster, :push_bound,
                          keyword_init: true) do
  def initialize(opts={})
    opts[:created] = Time.parse(opts[:created])
    opts[:ack_floor] = SequenceInfo.new(opts[:ack_floor])
    opts[:delivered] = SequenceInfo.new(opts[:delivered])
    opts[:config][:ack_wait] = opts[:config][:ack_wait] / ::NATS::NANOSECONDS
    opts[:config] = ConsumerConfig.new(opts[:config])
    opts.delete(:cluster)
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#stream_seqInteger

Returns The stream sequence.

Returns:

  • (Integer)

    The stream sequence.



1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
# File 'lib/nats/io/js.rb', line 1148

SequenceInfo = Struct.new(:consumer_seq, :stream_seq, :last_active,
                          keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields and freeze.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
    freeze
  end
end

#subjectsArray

Returns:

  • (Array)


1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
# File 'lib/nats/io/js.rb', line 1292

StreamConfig = Struct.new(
                          :name,
                          :description,
                          :subjects,
                          :retention,
                          :max_consumers,
                          :max_msgs,
                          :max_bytes,
                          :discard,
                          :max_age,
                          :max_msgs_per_subject,
                          :max_msg_size,
                          :storage,
                          :num_replicas,
                          :no_ack,
                          :duplicate_window,
                          :placement,
                          :mirror,
                          :sources,
                          :sealed,
                          :deny_delete,
                          :deny_purge,
                          :allow_rollup_hdrs,
                          :republish,
                          :allow_direct,
                          :mirror_direct,
                          keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end

#typeString

Returns:

  • (String)


1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
# File 'lib/nats/io/js.rb', line 1292

StreamConfig = Struct.new(
                          :name,
                          :description,
                          :subjects,
                          :retention,
                          :max_consumers,
                          :max_msgs,
                          :max_bytes,
                          :discard,
                          :max_age,
                          :max_msgs_per_subject,
                          :max_msg_size,
                          :storage,
                          :num_replicas,
                          :no_ack,
                          :duplicate_window,
                          :placement,
                          :mirror,
                          :sources,
                          :sealed,
                          :deny_delete,
                          :deny_purge,
                          :allow_rollup_hdrs,
                          :republish,
                          :allow_direct,
                          :mirror_direct,
                          keyword_init: true) do
  def initialize(opts={})
    # Filter unrecognized fields just in case.
    rem = opts.keys - members
    opts.delete_if { |k| rem.include?(k) }
    super(opts)
  end

  def to_json(*args)
    config = self.to_h
    config.delete_if { |_k, v| v.nil? }
    config.to_json(*args)
  end
end