Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

AEM OSGI Configuration

Avatar

Level 8

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.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

2 Replies

Avatar

Level 4

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.

Avatar

Level 8

Hi,

 

I want to mark this reply as correct.

 

But I do not see that button on this post.

 

Any ideas?

 

Thanks,

RK.