Broadleaf Microservices
  • v1.0.0-latest-prod

Configuration Example

Table of Contents

Overview

The following represents several configuration scenarios that are typical when using Broadleaf’s Asset Service.

Example Configuration

  • broadleaf.asset.internal.prependServletContextPath = true and the servlet context path for the asset service is /asset

  • broadleaf.asset.internal.contentResolverEndpointPath = "/content"

  • broadleaf.asset.internal.prependContentResolverEndpointPath = true

  • broadleaf.asset.internal.contentProviderUrlPrefix = "https://mycompany.cloudfrountcdn.com"

  • And the CloudFront CDN has configured its "origin server" as https://my-microservices.server.com

Assuming the above configuration, when the browser requests the primary image for Product 1, the asset service returns a asset with the url https://mycompany.cloudfrountcdn.com/asset/content/product-1-primary.png, i.e., contentProviderUrlPrefix/servletContextPath/contentResolverEndpointPath/asset-url

Alternatively, the origin server could be https://my-microservices.server.com/asset/content, meaning that prependServletContextPath and prependContentResolverEndpointPath should both be false. The asset url would then be returned as https://mycompany.cloudfrountcdn.com/product-1-primary.png, i.e., contentProviderUrlPrefix/asset-url.

Finally, consider if there was no CDN and contentProviderUrlPrefix = null. The Asset url would then be returned as https://my-microservices.server.com/asset/content/product-1-primary.png, i.e., servletUrl/contentResolverEndpointPath/asset-url.