Connect SDK - Frequently Asked Questions
Author:
Fluent Commerce
Changed on:
13 Dec 2023
Overview
Frequently Asked Questions on Connect SDK
Key points
- How will a connector built using Connect SDK fit if I already have middleware?
- I am unfamiliar with dockers and Localstack, which are used in reference solutions and connect SDK walkthroughs. What are they, and where do I learn more about them?
- Can we test the webhook endpoint exposed by Connect SDK locally? If so, how to do so?
- We don’t use AWS in our organization. How can I deploy connectors on GCP or Azure?
The interaction between a middleware and a connector built on top of the Connect SDK can occur in several ways, depending on the specific capabilities of the middleware and the connector. Here are a few potential interaction methods:
- HTTP/HTTPS Requests: If the connector exposes HTTP endpoints, the middleware can interact with it by making HTTP/HTTPS requests. This could involve sending GET, POST, PUT, DELETE, etc., requests to the connector's endpoints.
- Message Queues: If the connector is set up to read from message queues like Amazon SQS or Kafka, the middleware can send messages to these queues, which the connector will pick up and process.
- Databases: If the connector interacts with a database, the middleware could also interact with this database. This could involve the middleware writing data to the database that the connector reads and processes or vice versa.
- File Systems: If the connector reads from or writes to a file system, the middleware could interact with the connector by reading from or writing to the same file system.
- Sockets: If the connector and the middleware run on the same network or machine, they can communicate using sockets. Use this design if your architecture needs to use WebSockets.
- APIs: If the connector exposes an API, the middleware can interact with it by making API calls.
The specific method of interaction would depend on the capabilities and configuration of both the middleware and the connector.
Docker and LocalStack are both powerful tools used in software development. Here's a summary of both:
- Docker: Docker is an open-source platform that automates application deployment, scaling, and management. It does this by encapsulating applications into containers. A container packages an application and all its dependencies into a standardised unit for software development. This makes creating, deploying, and running applications using containers easier. Docker can be used on various systems: it is platform-independent. To learn Docker, you can start with the official Docker documentation and tutorials:
- LocalStack: LocalStack is a fully functional local AWS cloud stack that enables you to develop and test your cloud and Serverless apps offline. It spins up several mock AWS services locally, such as S3, DynamoDB, Lambda, and many others. This is particularly useful for testing your cloud applications offline before deploying them. To learn LocalStack, you can start with the official LocalStack GitHub repository and documentation:
Nice to know, but not necessary to work with Connect SDK:
When learning Docker, start with understanding what containers are, how they work, and why they're useful. Then, learn the basic Docker commands for managing containers and images. Once you're comfortable with that, you can start learning about Dockerfiles and docker-compose, which are used to create your own images and manage multi-container applications.
Necessary to work with Connect SDK in the local environment with AWS services:
When learning LocalStack, understand what AWS services like SQS, SecretManager, etc are and how they're used. Then, learn how to use LocalStack to mock these services for local development and testing. It's also helpful to understand how to use Docker, as LocalStack runs in a Docker container.
Here are some additional resources that you can use to learn Docker and LocalStack:
For Docker:
- Docker Curriculum: This comprehensive guide covers everything from the basics to more advanced topics. It's a great resource for beginners.
- Docker Tutorial by Tutorialspoint: This tutorial explains various aspects of Docker, starting with the basics and focusing on installation and more.
- Docker Tutorial by Guru99: This tutorial covers the basics, architecture, and containers.
For LocalStack:
- LocalStack Tutorials: These tutorials enhance your understanding of LocalStack's functionality by providing detailed information on how it works for specific use cases.
- Getting Started with LocalStack: This is a basic installation guide to start LocalStack on your local machine.
- Local Development with AWS on LocalStack by Reflectoring: This article explains how to use LocalStack for local AWS development.
Remember, the best way to learn is by doing. Try to follow along with the tutorials and create your own projects. This will give you practical experience and help solidify your understanding.
Absolutely! Connect SDK inherently provides a webhook endpoint at /api/v1/fluent/webhook. When operated locally on port 8080, the URL becomes localhost:8080/api/v1/fluent/webhook. Any webhook directed to this endpoint from the Fluent workflow is automatically authenticated through signature validation and placed in the event queue. The webhook payload can be processed if the webhook name aligns with the "message handler". To set this up in Fluent workflow, you can use ngrok to create a URL accessible via the internet but routes to your local system.
ngrok : It is a cross-platform application that enables developers to expose a local development server to the internet with minimal effort. It creates a secure tunnel from a public endpoint (such as a URL) to a locally running web service and provides real-time network log analysis.
Connect SDK officially supports AWS, but partners have the flexibility to integrate with other cloud platforms such as GCP and Azure. This can be achieved by overriding certain components:
- Secret Manager: Partners can refer to the Customization Guidelines for more details on implementing and configuring the Secret Manager integration.
- Queue Listener: Sample packages are provided to assist with integrating Connect SDK with different message queue systems. Partners can explore the following packages for reference:
Do note GCP module is in beta.- For AWS:
`connect-sdk-core-aws/src/main/java/com/fluentcommerce/connect/core/aws/listener`
- For Kafka:
`connect-sdk-core-kafka/src/main/java/com/fluentcommerce/connect/core/kafka/listener`
- For GCP:
`connect-sdk-core-gcp/src/main/java/com/fluentcommerce/connect/core/gcp/listener`
- For AWS: