Fluent Commerce Logo
Docs
Sign In

Dev Environment Setup for working with the Connect SDK

How-to Guide

Author:

Fluent Commerce

Changed on:

28 Nov 2023

Key Points

  • This article providfes you with templates to setup your local environment for developing with the Connect SDK 
  • Local development uses a Docker localstack to emulate AWS services.

Steps

Step arrow right iconConfiguring secrets in your localstack

Use the template below to create secrets in localstack before starting the application. The SDK expects ALL secrets to be prefixed with "fc/connect/\/". See Fluent Connector Configuration | Credential / Secrets Configuration for details on required secrets.

1docker exec -d localstack awslocal secretsmanager create-secret --name fc/connect/<FC-CONNECTOR>/api/fluent/activeAccounts --secret-string "{\"accounts\":[{\"name\":\"<FLUENT-ACCOUNT>\", \"region\":\"<FC-ACCOUNT-REGION>\" , \"retailers\":[<FLUENT-RETAILER1>,<FLUENT-RETAILER2>]}]}" ;
2docker exec -d localstack awslocal secretsmanager create-secret --name fc/connect/<FC-CONNECTOR>/<FLUENT-ACCOUNT>/api/fluent-account/<FLUENT-RETAILER> --secret-string "{\"retailer\":\"<FLUENT-RETAILER>\", \"userName\":\"<FC-USERNAME>\", \"password\":\"<FC-PASSWORD>\"}";

Language: plain_text

Name: Example

Description:

[Warning: empty required content area]

The property FC-CONNECTOR value must match the connector configuration name found at 

`application-connector.yml`
 (example below).

`connector-name: <FC-CONNECTOR>`

Step arrow right iconAWS CLI Configuration (Optional)

This is required when sending events to the queues or managing secrets in localstack directly from your terminal window.

  • Run the AWS configuration and set your localstack profile.
  • The access key values can be anything but empty
  • The region has to be us-east-1

`aws configure --profile localstack`

`export AWS_PROFILE=localstack`

Please note that localstack region is defaulted to "us-east-1".

IDE Setup

Step arrow right iconIntelliJ Setup

Create a run configuration setting the spring profiles and environment variables and selecting the correct pre-configured localstack AWS profile. The application runs precisely the same way as it would in production, which is achieved by the properties below.

  • Active Profiles: connector,dev-aws
    • `connector`
       profile is always required, and it can be followed by the environment the application runs on (dev, test, QA, or production).
    • `dev-aws`
       is a handy profile for local development with AWS. It enables the SDK to auto-start the queue and use some pre-configured values for development.
  • Environment Variables: SQS_BATCH=batch; SQS_EVENTS=events; SQS_NOTIFICATION=notification
    • These variables give actual names to the queues, as these may vary per environment.
  • AWS credential profile/region: Select the localstack profile and set the region to US-EAST-1.
    • Ensures the region matches with localstack and allows Spring to do the correct wiring of the AWS libraries.
No alt provided

For the IntelliJ community version, pass the spring profile configuration as JVM parameters:

`-Dspring.profiles.active=connector,dev-aws`

Step arrow right iconEclipse / STS Setup

Create a run configuration and set the spring profiles and the environment variables.

No alt provided
Fluent Commerce

Fluent Commerce

Copyright © 2024 Fluent Retail Pty Ltd (trading as Fluent Commerce). All rights reserved. No materials on this docs.fluentcommerce.com site may be used in any way and/or for any purpose without prior written authorisation from Fluent Commerce. Current customers and partners shall use these materials strictly in accordance with the terms and conditions of their written agreements with Fluent Commerce or its affiliates.

Fluent Logo