Fluent Commerce Logo
Docs
Sign In

commercetools Local Development Setup

How-to Guide

Author:

Fluent Commerce

Changed on:

31 Jan 2024

Key Points

  • Local development uses localstack to emulate AWS services
  • AWS CLI Configuration is optional
  • IntelliJ and Eclipse / STS  Setup in local environment

Steps

Step arrow right iconLocalstack

Local development uses localstack to emulate AWS services. Simply run the command below to have the image downloaded and the container running. Note that the container is set to always run unless stopped. Be aware that secrets and messages are not persisted between server restarts.

1docker-compose -f docker-compose.yml up -d localstack

Language: json

Name: Localstack

Description:

[Warning: empty required content area]

Step arrow right iconAWS CLI Configuration (Optional)

This is only required if one wants to send events to the queues in localstack or manage secrets through the AWS CLI outside the localstack container. Run the AWS configuration and set your profile. The access key values can be anything but the region has to be us-east-1

1aws configure --profile localstack
2export AWS_PROFILE=localstack

Language: json

Name: command line

Description:

[Warning: empty required content area]


Step arrow right iconIntelliJ Setup

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

  • Active Profiles: connector,dev-aws
    • `connector`
       profile is always required, and it should be followed by the environment the application is running on (dev, test, qa or production).
    • `dev-aws`
       is a handy profile for local development with AWS. It enables to the SDK to auto start the queue and use some pre-configured values for development.
  • Environment Variables: SQS_BATCH=batch;SQS_EVENTS=events;SQS_CONNECTOR=commercetools_events
    • 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 IntelliJ community version, pass the spring profile configuration as JVM parameters:

1--spring.profiles.active=connector,dev-aws

Language: json

Name: Profile

Description:

[Warning: empty required content area]


Step arrow right iconEclipse / STS Setup

Create a run configuration and set the spring profiles.

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