Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

how to view/modify OSGi configs in cloud, as /system/console/configMgr is blocked?

Avatar

Avatar
Ignite 10
Level 4
TB3dock
Level 4

Likes

34 likes

Total Posts

203 posts

Correct Reply

4 solutions
Top badges earned
Ignite 10
Boost 25
Give Back 25
Validate 10
Validate 1
View profile

Avatar
Ignite 10
Level 4
TB3dock
Level 4

Likes

34 likes

Total Posts

203 posts

Correct Reply

4 solutions
Top badges earned
Ignite 10
Boost 25
Give Back 25
Validate 10
Validate 1
View profile
TB3dock
Level 4

07-05-2021

We have built our app to be configurable via OSGi configurations, which is th AEM way.

This works great locally against the cloud SDK.

However, when we deploy to the cloud, the configMgr seems to be blocked.  This means we cant edit any of the critical run time variables, such as timeouts, switching features on off etc.

This is a huge problem. It would mean we have to re-write our services to read config from pages of the CMS or similar, which is a significant re-write.

Is there any work around to being able to view and edit our OSGi configs at runtime?

Adobe MUST remove these features from the cloudSDK if they are not available on any cloud env, otherwise we are developing for a completely different system.  this also includes the excellent i18n translation system, which is now removed on the cloud, but is still present in the SDK. This also required a significant rewrite, and is a very poor solution now.

 

Replies

Avatar

Avatar
Boost 100
Level 7
rush_pawan
Level 7

Likes

120 likes

Total Posts

192 posts

Correct Reply

77 solutions
Top badges earned
Boost 100
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Boost 100
Level 7
rush_pawan
Level 7

Likes

120 likes

Total Posts

192 posts

Correct Reply

77 solutions
Top badges earned
Boost 100
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile
rush_pawan
Level 7

07-05-2021

i don't think there is anything apart from trying through curl. refer below if it works for you.

 

https://sourcedcode.com/blog/aem/tool-generate-curl-command-to-update-osgi-configurations

Avatar

Avatar
Give Back 100
Level 10
asutosh_jena
Level 10

Likes

551 likes

Total Posts

663 posts

Correct Reply

191 solutions
Top badges earned
Give Back 100
Boost 500
Affirm 100
Ignite 1
Establish
View profile

Avatar
Give Back 100
Level 10
asutosh_jena
Level 10

Likes

551 likes

Total Posts

663 posts

Correct Reply

191 solutions
Top badges earned
Give Back 100
Boost 500
Affirm 100
Ignite 1
Establish
View profile
asutosh_jena
Level 10

07-05-2021

Hi @TB3dock 

 

As per AEM as Cloud service, all content and code persisted in the immutable repository must be checked into git and deployed through Cloud Manager.

As an example, OSGI configuration should be committed to source control rather than managed at runtime via the AEM web console’s configuration manager.

 

So you need to make the necessary changes on the developer’s local AEM environment with the AEM web console’s configuration manager and then exporting the results to the AEM project on the local file system. You need to ensure all the OSGi configurations are verified on local environment and commited to source control.

 

If you want to keep any functionality that needs to be updated during runtime, you can keep those as part of Context aware config which will reside under /conf and can be updated during runtime.

 

As you said the Cloud and local SDK are not in sync which is really an issue but if we are working on AEM as Cloud environment we need to ensure we follow the concept of mutable and immutable section in AEM and design the application accordingly to overcome these challenges during development.

 

Please refer the below article which speaks about the different ares of AEM with mutable and immutable concept:

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/implementing/developing/aem...

https://experienceleague.adobe.com/docs/experience-manager-learn/cloud-service/developing/basics/mut...

 

Hope this helps!

Thanks

Avatar

Avatar
Ignite 10
Level 4
TB3dock
Level 4

Likes

34 likes

Total Posts

203 posts

Correct Reply

4 solutions
Top badges earned
Ignite 10
Boost 25
Give Back 25
Validate 10
Validate 1
View profile

Avatar
Ignite 10
Level 4
TB3dock
Level 4

Likes

34 likes

Total Posts

203 posts

Correct Reply

4 solutions
Top badges earned
Ignite 10
Boost 25
Give Back 25
Validate 10
Validate 1
View profile
TB3dock
Level 4

08-05-2021

Hi, thanks for the reply, could you explain what the /conf is, and how we use it:

  1. how to put settings into it
  2. how to read settings from it into servlets
  3. how to modify these settings at run time
  4. how to specify initial settings per env.

All our (non-runtime modifiable) osgi config files are under ui.config, which seems odd, as none of them relate to UI, they all relate to configuring things in core (such as servlets, cors etc).

Avatar

Avatar
Springboard
Level 7
Prince_Shivhare
Level 7

Likes

107 likes

Total Posts

393 posts

Correct Reply

63 solutions
Top badges earned
Springboard
Establish
Give Back 100
Boost 100
Validate 1
View profile

Avatar
Springboard
Level 7
Prince_Shivhare
Level 7

Likes

107 likes

Total Posts

393 posts

Correct Reply

63 solutions
Top badges earned
Springboard
Establish
Give Back 100
Boost 100
Validate 1
View profile
Prince_Shivhare
Level 7

08-05-2021

Yes, we cannot do any changes related to config manager in higher environment.

We can push it  only by code repo.

however you can verify it by developer console and select option as a text.

and search the config name.

 

Thanks,

Prince

Avatar

Avatar
Ignite 10
Level 4
TB3dock
Level 4

Likes

34 likes

Total Posts

203 posts

Correct Reply

4 solutions
Top badges earned
Ignite 10
Boost 25
Give Back 25
Validate 10
Validate 1
View profile

Avatar
Ignite 10
Level 4
TB3dock
Level 4

Likes

34 likes

Total Posts

203 posts

Correct Reply

4 solutions
Top badges earned
Ignite 10
Boost 25
Give Back 25
Validate 10
Validate 1
View profile
TB3dock
Level 4

08-05-2021

Hi, for osgi configs, we have not seen a way to export them to file. It is generally very difficult to figure out exactly what the file name should be, and what the contents need to be to match a config setup in the configmgr, sometimes taking days of trial and error.

Avatar

Avatar
Give Back 100
Level 10
asutosh_jena
Level 10

Likes

551 likes

Total Posts

663 posts

Correct Reply

191 solutions
Top badges earned
Give Back 100
Boost 500
Affirm 100
Ignite 1
Establish
View profile

Avatar
Give Back 100
Level 10
asutosh_jena
Level 10

Likes

551 likes

Total Posts

663 posts

Correct Reply

191 solutions
Top badges earned
Give Back 100
Boost 500
Affirm 100
Ignite 1
Establish
View profile
asutosh_jena
Level 10

08-05-2021

Hi @TB3dock 

 

/conf in AEM holds all the configuration items such as

  • Cloud Configurations
  • ContextHub segments
  • Content Fragment Models
  • Editable Template confirgurations
  • Context Aware Configs and so on...

 

Context aware config can be created which can be further divided into each site level or locale level and the same can be referenced in any OSGi service, servlet or model classes.

Let's take an example of a single website with 2 different locale such as en_us and en_ca and for each of these locales we want to load different API token across environment, then you can define the same in context aware config and a single peice of code will take the appropriate locale specific value at runtime and these values can be changed at runtime as it will be deployed as part of the content package.

 

All these settings will be stored under /conf/[project-name]/ with different subfolder names as required by the configuration.

 

For OSGi configs the file name needs to be same as the PID name and if it's a factory configuration, then we need to add an identifier into it like we do for logger configuration.

 

Please see the details about the Context Aware Configuration:

https://sling.apache.org/documentation/bundles/context-aware-configuration/context-aware-configurati...

 

In short, if you want to configure something which is different based on environment, it has to be configured in OSGi which cannot be modifed during runtime on AEM as Cloud and needs to be part of the code deployment which will be kept under /apps/project/osgi.... If you want to configure something which is different based on website not based on the environment, it can be configured in Context aware config and can be stored under /conf which can be deployed via code as well as content package and can be modified at runtime using AEM as Cloud.

 

Thanks!

Avatar

Avatar
Ignite 10
Level 4
TB3dock
Level 4

Likes

34 likes

Total Posts

203 posts

Correct Reply

4 solutions
Top badges earned
Ignite 10
Boost 25
Give Back 25
Validate 10
Validate 1
View profile

Avatar
Ignite 10
Level 4
TB3dock
Level 4

Likes

34 likes

Total Posts

203 posts

Correct Reply

4 solutions
Top badges earned
Ignite 10
Boost 25
Give Back 25
Validate 10
Validate 1
View profile
TB3dock
Level 4

08-05-2021

Thanks for the info. I have read that link twice, but still cant figure it out. I get that there js a /conf in the crxde editor, and I am guessing we would use the crxde editor to edit the settings at run time, is this correct? The next issue is how do we get items into /conf in the right format? we dont have a conf sub project in our source code, we only have things like myapp.ui.config, myapp.ui.content and myapp.core. Second issue, is how do we read this data from a servlet?  The link you kindly provided has this linke of code:

Resource contentResource = resourceResolver.getResource("/content/mysite/page1");

But then only has examples reading config properties from htl templates, not from servlets.  There some limited info about interfaces, and an example interface with "param1" and "intParam", but there is no obvious way to glue these parameters with the corresponding config object. With osgi, this is done making the file name the same as the PID (with some differences), and then putting the corresponding files in the ui.config under /aem-guides-wknd.ui.config/src/main/content/jcr_root/apps/wknd/osgiconfig/config for example.

Avatar

Avatar
Boost 5
Level 5
Ritesh_M
Level 5

Likes

86 likes

Total Posts

73 posts

Correct Reply

24 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 1
View profile

Avatar
Boost 5
Level 5
Ritesh_M
Level 5

Likes

86 likes

Total Posts

73 posts

Correct Reply

24 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 1
View profile
Ritesh_M
Level 5

08-05-2021

 

Hi @TB3dock ,

 

I do not think there is a way (only through GIT) as per documentation-

 

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/release-notes/aem-cloud-cha...

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,348 likes

Total Posts

3,226 posts

Correct Reply

916 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,348 likes

Total Posts

3,226 posts

Correct Reply

916 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

08-05-2021

curl will also not work because it will try to save config inside /apps/ which is immutable