Product Availability Enrichment
Author:
Fluent Commerce
Changed on:
20 Feb 2024
Key Points
- You would first need to have access to a Fluent account, and have
`localstack`container running. - There are two possible cache configurations: In-memory cache or External cache.
Prerequisites
Steps
Overview
- Creating a transformation step
- Define cache configuration to improve the performance of product availability calls
- In-memory cache
- External cache
- Cacheable sample
Prerequisites
- localstack container is running
- You have access to a Fluent account
`localstack-setup.sh` bundled with the project that can be used to set up localstack. The script requires some parameters to be configured before it can be executed.It is best to do the following:First, run this command to open a session with the localstack containerThen use the commands below to create the secrets, but ensure to update the variables: $ACCOUNT, $RETAILER, $USERNAME, $PASSWORD and $REGION. Regions values are: sydney, dublin, singapore or north_america.Use ctrl + D to exit the localstack session.
Define transformation step
`@FulfilmentOptionTransformationStep`, partners can define multiple transformation step to enrich the fulfilment-option’s response & decide the priority of these steps: 
Define cache configuration to improve the performance of product availability calls
In-memory cache
The Connect-sdk employs Caffeine-cache as its default cache provider. In addition to the default cache keys of connect-sdk, partners can define their own cache keys with custom configuration. This can be achieved by specifying:`name`: cache-names`expiry-in-seconds`: time-to-live of cache key`max-size`: capacity of the cache
External cache
If partners want to integrate with the other kinds of Cache Providers please refer to Spring-cache solution: IOFor example, to define a new Cache Manager using Redis Cache:Cacheable sample:
Get Fulfilment Option
