Expand my Community achievements bar.

Join us in celebrating the outstanding achievement of our AEP Community Member of the Year!
SOLVED

Reverse distribution OSGI config for Blue Green Deployment

Avatar

Level 2

Hello,

I have a OSGI config for reverse distribution on author that establishes the connection with publisher for reverse distribution of data from publisher to author.

Config:

org.apache.sling.distribution.agent.impl.ReverseDistributionAgentFactory

packageExporter.endpoints=["https://<domain1-of-publisher/libs/sling/distribution/services/exporter/<agent-target-name-set-on-publisher>","https://<domain2-of-publisher/libs/sling/distribution/services/exporter/<agent-target-name-set-on-publisher>"]

Publisher domain changes with every blue green deployment swap. Is there a recommended approach to handle this kind of configuration for blue green deployment?

1 Accepted Solution

Avatar

Correct answer by
Level 1

Dynamic Configuration Updates:

  • Utilize a configuration management tool (e.g., Apache Felix Configuration Manager, Apache Sling Feature Flags) to dynamically update the endpoints in the packageExporter.endpoints property based on the active publisher domain.
  • Example using Feature Flags:
    • Create feature flags for each domain (e.g., domain1-active, domain2-active).
    • Modify distribution configurations to reference these flags. (' reels saver)
    • Activate the appropriate flag during deployment to switch domains seamlessly.

Endpoint Resolution Service:

  • Implement a custom service that resolves the publisher endpoint at runtime, considering the active deployment environment.
  • Inject this service into the distribution agent configuration to fetch the correct endpoint dynamically.

Environment-Specific Configurations:

  • Create separate OSGi configuration files for each environment (e.g., author-blue.config, author-green.config).
  • Activate the appropriate configuration during deployment, ensuring the correct endpoints are used. 

Shared Configuration Store:

  • Store endpoint information in a shared configuration store (e.g., ZooKeeper, Consul) 
  • Read endpoints from the store at runtime, adjusting for the active environment.

View solution in original post

3 Replies

Avatar

Community Advisor

Hi @zaddm98685815 This could be a question for the AEM Sites community. Have you tried pointing to the Publish Load Balancer if that works?

 

Thanks

Narendra

Avatar

Correct answer by
Level 1

Dynamic Configuration Updates:

  • Utilize a configuration management tool (e.g., Apache Felix Configuration Manager, Apache Sling Feature Flags) to dynamically update the endpoints in the packageExporter.endpoints property based on the active publisher domain.
  • Example using Feature Flags:
    • Create feature flags for each domain (e.g., domain1-active, domain2-active).
    • Modify distribution configurations to reference these flags. (' reels saver)
    • Activate the appropriate flag during deployment to switch domains seamlessly.

Endpoint Resolution Service:

  • Implement a custom service that resolves the publisher endpoint at runtime, considering the active deployment environment.
  • Inject this service into the distribution agent configuration to fetch the correct endpoint dynamically.

Environment-Specific Configurations:

  • Create separate OSGi configuration files for each environment (e.g., author-blue.config, author-green.config).
  • Activate the appropriate configuration during deployment, ensuring the correct endpoints are used. 

Shared Configuration Store:

  • Store endpoint information in a shared configuration store (e.g., ZooKeeper, Consul) 
  • Read endpoints from the store at runtime, adjusting for the active environment.

Avatar

Employee

@zaddm98685815 Did you find the suggested solutions helpful? It would be great if you can  mark the answer as correct for posterity. If you have found out solution yourself, share it with wider audience in the community.