mirusresearch / firehoser

A wrapper around AWS Kinesis Firehose with retry logic and custom queuing behavior. Requires node >= 6.0.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can this work if i want to specify delivery stream at runtime?

yarivat opened this issue · comments

@yarivat It depends on whether the streams share the same AWS config/auth details. - If they do, you could instantiate multiple streams in a map/object:

const fhstreams = {
  foo : new firehoser.DeliveryStream('stream_foo'),
  bar : new firehoser.DeliveryStream('stream_bar'),
};

and do fhstreams.foo.putRecord('value1|value2|value3')

If the streams don't share the same AWS auth credentials , then I think you'd have a problem. The class doesn't instantiate its own AWS config instance, but seems to re-use a root scope AWS, which would result in secondary instances changing the shared AWS config and potentially messing things up.

Alternatively, you could instantiate a new instance per-event with different credentials and streams each time, but that sounds terrible from a performance standpoint.