AEM OSGI Configuration | Community
Skip to main content
New Participant
July 8, 2025

AEM OSGI Configuration

  • July 8, 2025
  • 1 reply
  • 338 views

Hi all,

 

What are all the means of creating AEM OSGI Configuration?

I mean configuration placeholder, not the actual configuration itself.

 

I saw an example using code: https://www.youtube.com/watch?v=_ebHx8LyCkQ.

 

Is it possible to create it manually using Felix console or some other means?

 

Appreciate all your responses.

 

Thanks,

RK.

1 reply

New Participant
July 8, 2025

Hi @nsvsrk ,

 

OSGI Config:

  • Whenever we need to pass different values (ex: service endpoints) to the same parameters based on run mode(environment, ex: Dev), we shall use OSGI configs.
  • These configs help to make this change without touching code and restart the server.
  • There is a java class which read values from the respective configuration into code, in that java class we shall provide default values but in OSGI configuration we need to pass the actual value as this value take precedence.
@Getter @Component( service = SampleConfig.class, immediate = true, configurationPolicy = ConfigurationPolicy.REQUIRE ) @Designate(ocd = SampleConfig.Configuration.class) public class SampleConfig { … … @ObjectClassDefinition( name = “Sample”, description = “Sample” ) public @interface Configuration { @AttributeDefinition(name = “Prop1) String prop1(); @AttributeDefinition(name = “Prop2”) boolean prop2() default true; } }
  • As fas as i know, we can create through code only.

Thanks,

Raju.

nsvsrkAuthor
New Participant
July 10, 2025

Hi,

 

I want to mark this reply as correct.

 

But I do not see that button on this post.

 

Any ideas?

 

Thanks,

RK.