AEMasCS request not coming to custom farm dispatcher | Community
Skip to main content
Level 2
September 2, 2024
Solved

AEMasCS request not coming to custom farm dispatcher

  • September 2, 2024
  • 5 replies
  • 1377 views

I have created a custom farm abc.farm in the dispatcher config and created a symlink under enabled_farms

The issue is when I hit any page in local dispatcher, I see the request coming to the default_farm and not to my custom farm

However, if I rename the abc.farm to xyz.farm( to make sure the file is included below the default_farm) then I see the requests coming to my custom xyz.farm in the dispatcher logs

Not working scenario - 

 

| - /available_farms | - abc.farm | - default.farm

 

Working scenario - 

 

| - /available_farms | - default.farm | - xyz.farm

 

What could be the reason for this

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ManviSharma

Hi,

To ensure your custom farm (abc.farm) is processed after the default farm, you can either:

  1. Rename the Farm File:

    • Rename abc.farm to something that alphabetically follows default.farm, such as xyz.farm.
  2. Explicitly Control Inclusion Order:

    • Modify the dispatcher configuration to explicitly include abc.farm after default.farm.

Example Configuration

Assuming your dispatcher configuration file is dispatcher.any, you can control the inclusion order like this:

# dispatcher.any

/available_farms {
    /farms {
        "/default" {
            $include "/path/to/available_farms/default.farm"
        }
        "/abc" {
            $include "/path/to/available_farms/abc.farm"
        }
    }
}

In this example, default.farm is explicitly included before abc.farm, ensuring the desired order of processing.

5 replies

MukeshYadav_
Community Advisor
Community Advisor
September 2, 2024
EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
September 2, 2024

Hi, 

Most likely you have an issue with your virtualHosts, please check how the farms and virtualHosts are resolved, this will clarify your doubts: https://experienceleague.adobe.com/en/docs/experience-manager-dispatcher/using/configuring/dispatcher-configuration#resolving-the-virtual-host 

 

Hope this helps

Esteban Bustamante
h_kataria
Community Advisor
Community Advisor
September 2, 2024

Your default farm generally has a catch-all vhost configuration which means if a request is coming from a vhost which is not matched, it will by default go to that farm. 
Since you are calling it from your local, if you have not set up a vhost it will by default go to the default farm itself. 

You will probably have to setup a virtual host on your local (on widows you can do that by editing host file c:\WINDOWS\system32\drivers\etc\hosts), provide proper vhost entries in dispatcher config and then use that host to call the page. 
Hope this helps.

HiteshRa3Author
Level 2
September 2, 2024

But how does it work when I change the order of how the files are included, when I place the default_farm on top then I see the request coming to my custom farm

h_kataria
Community Advisor
Community Advisor
September 2, 2024

I would assume both your farms have similar entries for virtualhost (probably {"*"}), so dispatcher picks up the lowest farm entry by default as it will be a match. You can cross check that once.

ManviSharma
Adobe Employee
ManviSharmaAdobe EmployeeAccepted solution
Adobe Employee
September 2, 2024

Hi,

To ensure your custom farm (abc.farm) is processed after the default farm, you can either:

  1. Rename the Farm File:

    • Rename abc.farm to something that alphabetically follows default.farm, such as xyz.farm.
  2. Explicitly Control Inclusion Order:

    • Modify the dispatcher configuration to explicitly include abc.farm after default.farm.

Example Configuration

Assuming your dispatcher configuration file is dispatcher.any, you can control the inclusion order like this:

# dispatcher.any

/available_farms {
    /farms {
        "/default" {
            $include "/path/to/available_farms/default.farm"
        }
        "/abc" {
            $include "/path/to/available_farms/abc.farm"
        }
    }
}

In this example, default.farm is explicitly included before abc.farm, ensuring the desired order of processing.

kautuk_sahni
Community Manager
Community Manager
September 13, 2024

@hiteshra3 Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Kautuk Sahni