UNPKG

loopback-connector-firehose

Version:

Loopback.js connector for Amazon Kinesis Firehose

47 lines (34 loc) 1.41 kB
## loopback-connector-firehose Loopback connector for AWS Kinesis Firehose #### Usage First make sure that you have AWS credentials in `.aws/credentials` file. Next, make sure that in your `datasources.json` the something like the following exists: ``` "firehose": { "name": "firehose", "connector": "loopback-connector-firehose", "region": "us-west-1", "DeliveryStreamName": "delivery-stream-name", "ColumnNames": ["messageId","stringData"] } ``` Where `ColumnNames` is the RedShift column name for which your delivery stream has been constructed. This connector is a non-database connector, which means that standard API representing CRUD operations does not get created by default. Instead it binds the `send` remoting method to the model. The data that gets sent to it will be formed into pipe delimited string, which will then be sent out. If data being passed into the connector includes `DeliveryStreamName`, the connector will use that instead of settings defined one. This is recommended when you have many different delivery streams for a given abstract model defined route. To use dynamic delivery stream, make sure your abstract model has remoting hook that sets the delivery stream name before remoting: ``` MyModel.beforeRemoting( 'send', function( ctx, modelInst, next) { ctx.args.data.DeliveryStreamName = "delivery-stream-name"; next(); }); ```