Coder Social home page Coder Social logo

stealth-tech-startup / aws-producer-service Goto Github PK

View Code? Open in Web Editor NEW

This project forked from screwdriver-cd/aws-producer-service

0.0 0.0 0.0 37 KB

Screwdriver AWS Integration Producer Service

Home Page: https://cd.screwdriver.cd/pipelines/7971/events

License: Other

JavaScript 100.00%

aws-producer-service's Introduction

aws-producer-service

Screwdriver AWS Integration Producer Service Version Downloads Build Status Open Issues License

Producer Service for Screwdriver Kafka Queue

This service acts as a message producer and provides and interface to publish messages to Screwdriver Kafka Instance.

Table of Contents

Installation and Usage

npm install screwdriver-aws-producer-service

Configuration

The configuration for the package

Parameter Type Default Description
enabled bool true Flag for enabling broker config
hosts array [] Array of broker endpoints
sasl object sasl object
sasl.mechanism string scram-sha-512 sasl mechanism
sasl.secretId string - AWS secret manager id for sasl secret
clientId string - Client id connecting to kafka brokers
accessKeyId string - AWS access key id
secretAccessKey string - AWS secret key id
region string - AWS region
kafka:
  # flag for kafka broker
  enabled: true
  # kafka brokers list
  hosts: KAFKA_BROKERS_LIST
  # sasl options
  sasl:
    # sasl mechanism
    mechanism: scram-sha-512
    # secret id for sasl/scram
    secretId: fakesecret
  # client id of the producer
  clientId: sd-producer
  # Amazon access key
  accessKeyId: KAFKA_ACCESS_KEY_ID
  # Amazon secret access key
  secretAccessKey: KAFKA_ACCESS_KEY_SECRET
  # AWS region 
  region: AWS_REGION

Methods

Producer Methods

connect

Expected Outcome

Connects as a client instance to the kafka broker based on the specified configuration

Expected Return

A Promise that resolves to a Kafka producer object.

sendMessage

Expected Outcome

Sends a message to a kafka topic.

Required Parameters
Parameter Type Description
producer Object The producer object after calling connect()
data Object The message data object
topic String The name of the topic
messageId String The id of the message

Admin Methods

connectAdmin

Expected Outcome

Connects as a client instance to the kafka broker based as an admin with elevated permissions on the specified configuration

Expected Return

A Promise that resolves to a Kafka admin object.

createTopic

Expected Outcome

Creates a kafka topic and disconnects the admin connection.

Required Parameters
Parameter Type Description
admin Object The admin object after calling connectAdmin()
topic String The name of the topic

getTopicMetadata

Expected Outcome

Gets kafka metadata for the give kafka topic and disconnects the admin connection.

Required Parameters
Parameter Type Description
admin Object The admin object after calling connectAdmin()
topic String The name of the topic
Expected Return

A Promise that resolves to a Kafka topic metadata object.

Testing

npm test

Contribute

To start contributing to Screwdriver, have a look at our guidelines, as well as pointers on where to start making changes, in our contributing guide.

License

Code licensed under the BSD 3-Clause license. See LICENSE file for terms.

aws-producer-service's People

Contributors

pritamstyz4ever avatar klu909 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.