Saturday, 9 May 2020

AEM as a Cloud Service: Dispatcher Setup

Local Dispatcher Setup

Dispatcher Setup

The AEM as a Cloud Service SDK includes a validator tool and docker image for simulating it locally.
 Dispatcher Tools is comprised of:
  • a baseline set of Apache HTTP Web server and Dispatcher configuration files, located in .../dispatcher-sdk-x.x.x/src
  • a configuration validator CLI tool, located at .../dispatcher-sdk-x.x.x/bin/validator
  • a configuration deployment CLI tool, located at .../dispatcher-sdk-x.x.x/bin/docker_run
  • a Docker image that runs Apache HTTP Web server with the Dispatcher module
Before we start, make sure AEM SDK setup is completed locally. It's ideal to setup AEM publish environment for your dispatcher to map. Install and start the latest version of Docker (Docker Desktop 2.2.0.5+ / Docker Engine v19.03.9+) on the local development machine.

Download AEM SDK, navigate to your AEM folder (where dispatcher tools are available).
AEM SDK
Unpack the Dispatcher Tools into ~/aem-sdk/dispatcher
[email protected] dispatcher % chmod a+x aem-sdk-dispatcher-tools-2.0.22-unix.sh                                            

[email protected] dispatcher % ./aem-sdk-dispatcher-tools-2.0.22-unix.sh 

Creating directory dispatcher-sdk-2.0.22

Verifying archive integrity...  100%   All good.

Uncompressing dispatcher-sdk-2.0.22  100%  

[email protected] dispatcher % ls

aem-sdk-dispatcher-tools-2.0.22-unix.sh		dispatcher-sdk-2.0.22

aem-sdk-dispatcher-tools-2.0.22-windows.zip 


The above command creates a new folder and unpacks dispatcher tools to it. A complete description of the configuration files is available in the unpacked Dispatcher Tools as dispatcher-sdk-x.x.x/docs/Config.html.


Validate Dispatcher Configs:

Before we run the Dispatcher locally, it's advised to validate the configs using Dispatcher Tools's validator CLI tool. Also it transpiles the configurations into a file-set compatible with the Docker container's Apache HTTP Web Server.

./bin/validator full -d ./out ./src 


This creates new "out" folder. Run below command.

./bin/docker_run.sh <deployment-folder> <aem-publish-host>:<aem-publish-port> <dispatcher-port>


The aem-publish-host can be set to host.docker.internal, a special DNS name Docker provides in the container that resolves to the host machine's IP. If he host.docker.internal does not resolve, please see the troubleshooting section below.

./bin/docker_run.sh ./out host.docker.internal:4503 8080


The AEM as a Cloud Service SDK's Publish Service, running locally on port 4503 will be available through Dispatcher at http://localhost:8080.

Access WNKD site with the dispatcher URL.


Dispatcher


1 comment :

  1. Great Article
    Cloud Computing Projects


    Networking Projects

    Final Year Projects for CSE


    JavaScript Training in Chennai

    JavaScript Training in Chennai

    The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

    ReplyDelete