Menu

Custom Dispatcher flush rule setup | acs commons

Create a custom dispatcher flush rule for your content, which an author can trigger using UI, without any involvement of developer and DevOps person. This is a single click activity for an author to invalidate the dispatcher cache.

For this ACS-commons provide a powerful which we need to configure in our AEM author instance. Here are the steps to set up the custom dispatcher flush using acs-commons.

 

Step 1: Log in to AEM instance.


Step 2: Download the acs-commons latest version from acs official site and install the acs-commons package in your AEM instance using AEM package manager [http://localhost:4502/crx/packmgr].


Step 3: After the successful installation of acs-commons, browse to AEM tools section. http://localhost:4502/miscadmin


Step 4: Now create a dispatcher flush page to set up your dispatcher configuration. Below is the screenshot.

1. Click on the Dispatcher Flush directory from the left rail.

2. Click on the new button from the menu bar, and select the option, New Page. As soon as you click on the New Page option a new window will appear. As highlighted below.

3. Put the Title and Name for the page. e.g. custom dispatcher flush

4. Click on the create button.

5. This will create a custom-dispatcher-flush page under the Dispatcher Flush directory.


Custom dispatcher flush

Step 5: Open this newly created "custom dispatcher flush" page. To open double click on the page name. Our custom dispatcher flush page will look like as below.

Custom dispatcher flush in AEM

Note: In the above screenshot we could see under the Active Dispatcher Flush Agent there is no active dispatcher flush replication agent is showing.

Step 6: Click on the Edit option from next to the Dispatcher Flush Configuration. Once we click on Edit, the configuration settings option will appear. Here we have to set the following;
1. Flush method - We need to specify whether we want to invalidate the caching or completely delete the caching from the dispatcher server.
2. Paths to flush - We will list all the path and pages which we want to invalidate or delete from the dispatcher server.

Dispatcher Flush Configuration- AEM dispatcher server

Step 7: Now we have to enable the Dispatcher Flush agent queue on AEM author. [http://localhost:4502/etc/replication/agents.author/flush.html]. If the AEM instance is already configured with dispatcher then we need not do anything extra in this case, just verify the Dispatcher Flush agent from the above-mentioned path. 

In case the dispatcher Flush is not setup then configure the following in properties in the configuration setting.

1. Edit the Dispatcher Flush settings. Click on the Edit button from the below screen.

2. Enabled - Check enabled option.

3. Move to the transport tab and set the following

a. URI - URL of the dispatcher server.

b. User - a transport user name

c. Password - password of transport user


Our dispatcher configuration is set, now using the Test Connection option we can verify the configuration setting and ensure everything is fine. 


Dispatcher Flush agent- AEM replication

Step 8: We have done with our custom dispatcher setup.

Step 9: Now go back to your custom dispatcher page which we had created in Step 4. Open the page and see the changes. In the dispatcher flush page now we could see Flush paths on Dispatcher button and Dispatcher Flush under Active Dispatcher Flush Agent.

Step 10: Click on Flush Paths on the Dispatcher button highlighted in red to invalidate and delete the caching from the dispatcher server. Below is the screenshot. After triggering the flush go and validate the status of the cached content.
 
Dispatcher flush
Dispatcher flush

References:

Adobe consulting services: 

How to change default port for Spring boot

Default port for Spring boot application is 8080, what if someone want to run their application other than port 8080 or other than default port. Where we need to put the port setting in project, so instead of default port 8080 Spring boot application start on port which we configure.

By Default Spring boot run on port 8080 and no where in your project you will find the port setting, if you just started a new Spring boot project. If you want to change the default port then you have to add the port setting in your project.

Where to put the port setting?

We need to add port setting in projects application.properties file. You will find this properties file under project directory > src > main > resources > application.properties

open application.properties file and add a new property server.port followed by port number. below is the example.
server.port = 8020

Nested if else in Bash Shell scripting

Today in this tutorial we will see how to write if else and nested if else in Bash Shell scripting.


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Program in Bash Shell

CHECK_SOURCE="[main] INFO com.dobe.jcr.checknode.existence.App - Node  exists"

echo $CHECK_SOURCE | grep -w -o -i 'Node exists'

if [ $? == 0 ]; then

    echo " Node Exists"

    echo $CHECK_SOURCE | grep -w -o -i 'checknode'

    if [ $? == 0 ]; then

        echo "checknode exist"

        echo $CHECK_SOURCE | grep -w -o -i 'adobe'

            if [ $? == 0  ]; then

                echo "Adobe exist"

            else

                echo "Adobe doesnot Exist"

            fi

    else

        echo "checknode doesnot Exist"

    fi

else

    echo "Node doesnot Exists"

fi

You may download the raw from Gist: https://gist.github.com/RashidJorvee/9e9de5c6f8fd2303d0438b492ee9ad33