Giter Club home page Giter Club logo

amazon-rabbitmq-msk-saslscram-camel-integration's Introduction

amazon-rabbitmq-msk-saslscram-camel-integration

This project demonstrates how data could be streamed from Amazon RabbitMQ to a SASL/SCRAM enabled Amazon MSK, through Apache Camel.

Workflow

CamelConnector

  • RabbitMQ is a popular open source message broker with a vast range of functionality such as flexible routing/dead letter exchanges/multi-protocol support.
  • Apache Kafka is an open source highly scalable real-time messaging system used in event driven communications / distributed event processing .
  • Apache Camel is an opensource integration framework supporting various enterprise integration patterns

TODO

  1. Integrate with AWS Secrets Manager.

Pre-requisites:

  1. Amazon Rabbit MQ is setup to have public access (associated with a public subnet) and is listening on port 5671.
  2. MSK is setup with SASL/SCRAM authentication (https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html#msk-password-tutorial) in a private subnet.
  3. Apache Camel runs on an EC2 in a public subnet in the same VPC as Amazon MQ and Amazon MSK.
  4. Install Maven to build the project.
      mvn clean install
    
  5. Install jre >=8 to run the project.
      java -jar camel-kafka-sasl-scram-connector-1.0-SNAPSHOT.jar 
    


Apache Camel Component Details

  • Amazon RabbitMQ Pub/Sub Configuration: When publishing or subscribing to Amazon RabbitMQ queue below are some common important parameters to set for publishers and subscribers:

    sslProtocol: TLS
    portNumber: 5671
    userName: ***
    password: ******
    
  • Amazon MSK Pub/Sub Configuration: For a SASL/SCRAM authentication based MSK below are the common important parameters to set for producers and consumers:

    saslMechanism: SCRAM-SHA-512
    securityProtocol=SASL_SSL
    sslEndpointAlgorithm=HTTPS
    saslJaasConfig=org.apache.kafka.common.security.scram.ScramLoginModule required username=fraser password=fraser-secret;
    

    MSK supports SCRAM-SHA-512 sasl mechanism


Apache Camel Routes:

  1. Data Generator Route: This route generates json events every 500ms and pushes it to a RabbitMQ queue (queue-name=logs)
 Class Name: TestDataGenerator.java
  1. RabbitMQ Subscriber Route: This route polls the Rabbit MQ queue and pushes data to an MSK topic call iot-downstream.
 Class Name: TestDataGenerator.java
  1. MSK Consumer Route: This route subscribes to the iot-downstream topic on MSK and logs the data.
Class Name: PubSubRouter.java

This project comes bundled with Hawtio. Hawtio is used to

monitor/manage camel routes. Its available as a springboot actuator and is accessible at

  • http://{your-ip-address}:8080/actuator/hawtio

Steps to build and deploy

  1. mvn clean install
  2. cd target
  3. java -jar camel-kafka-sasl-scram-connector-1.0-SNAPSHOT.jar

amazon-rabbitmq-msk-saslscram-camel-integration's People

Contributors

amazon-auto avatar fraser27 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  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.