Expand my Community achievements bar.

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

Getting ServerName from Event Handler

Avatar

Level 1

Hello,

 

I am working on Cloud AEM.

 

I am working on Event Handler to call our api on page replication.

For which I am using a ReplicationAction to know path and user details.

 

I have a requirement to know which is the server it is like prod/stage/dev/rde

AMS gives this info from this.slingSettingsService.getRunModes() 

Where as Cloud is not returning expected values.

 

In servlet, I can get server url like this req.getServerName()

But Since this is my Event Listener class, I am not getting way to get server details.

 

Can anyone guide on this how to get server name with event listener?

 

Regards

Kiran

Topics

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

1 Accepted Solution

Avatar

Correct answer by
Level 6

Hi @KiranKo5 ,

You can create an OSGI config to set the environment type and set different values using environment variables.

Refer -https://blog.developer.adobe.com/custom-runmodes-on-aem-as-a-cloud-service-79b757f51a6b 

View solution in original post

1 Reply

Avatar

Correct answer by
Level 6

Hi @KiranKo5 ,

You can create an OSGI config to set the environment type and set different values using environment variables.

Refer -https://blog.developer.adobe.com/custom-runmodes-on-aem-as-a-cloud-service-79b757f51a6b