<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AEMaaCS Archives - Sourced Code</title>
	<atom:link href="https://sourcedcode.com/blog/category/aem/aemaacs/feed" rel="self" type="application/rss+xml" />
	<link>https://sourcedcode.com</link>
	<description>AEM Blog Made Just for You.</description>
	<lastBuildDate>Fri, 10 Apr 2026 20:15:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.8</generator>

<image>
	<url>https://sourcedcode.com/wp-content/uploads/2019/09/cropped-favicon-32x32.png</url>
	<title>AEMaaCS Archives - Sourced Code</title>
	<link>https://sourcedcode.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Pipeline-Free URL Redirects &#038; ACS Commons Redirect Map Manager Now Supported on AEMaaCS</title>
		<link>https://sourcedcode.com/blog/aem/pipeline-free-url-redirects-acs-commons-redirect-map-manager-now-supported-on-aemaacs</link>
					<comments>https://sourcedcode.com/blog/aem/pipeline-free-url-redirects-acs-commons-redirect-map-manager-now-supported-on-aemaacs#respond</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Thu, 07 Nov 2024 02:11:50 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[AEMaaCS]]></category>
		<category><![CDATA[Caching]]></category>
		<category><![CDATA[Dispatcher]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=7520</guid>

					<description><![CDATA[<p>Adobe’s recent AEM version 18311 release (October 28-30, 2024) brings valuable updates for URL redirection management in AEM as a Cloud Service (AEMaaCS). This release introduces Pipeline-Free URL Redirects and, importantly, full support for ACS Commons Redirect Map Manager. These changes allow AEM developers to manage URL redirects directly within the AEM Cloud environment, with [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/pipeline-free-url-redirects-acs-commons-redirect-map-manager-now-supported-on-aemaacs">Pipeline-Free URL Redirects &#038; ACS Commons Redirect Map Manager Now Supported on AEMaaCS</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Adobe’s recent <strong>AEM version <a href="https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/release-notes/maintenance/2024/2024-10-0?lang=en#18311" rel="noopener" target="_blank">18311</a></strong> release (October 28-30, 2024) brings valuable updates for URL redirection management in <strong>AEM as a Cloud Service (AEMaaCS)</strong>. This release introduces <strong><a href="https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/content-delivery/pipeline-free-url-redirects" rel="noopener" target="_blank">Pipeline-Free URL Redirects</a></strong> and, importantly, full support for <strong><a href="https://adobe-consulting-services.github.io/acs-aem-commons/features/redirect-map-manager/index.html" rel="noopener" target="_blank">ACS Commons Redirect Map Manager</a></strong>. These changes allow AEM developers to manage URL redirects directly within the AEM Cloud environment, with improved performance, scalability, and flexibility.</p>
<div class="mention-block">
    <strong>Quick Links</strong></p>
<ol>
<li><a href="#background_redirect_map_manager_vs_redirect_manager_in_aemaacs">Background: Redirect Map Manager vs. Redirect Manager in AEMaaCS</a></li>
<li><a href="#key_benefits_of_the_new_setup">Key Benefits of the New Setup</a></li>
<li><a href="#how_to_configure_pipeline_free_url_redirects_with_redirect_map_manager">How to Configure Pipeline-Free URL Redirects with Redirect Map Manager</a></li>
<li><a href="#conclusion">Conclusion</a></li>
</ol>
</div>
<p><a href="https://sourcedcode.com/wp-content/uploads/2024/11/adobes-redirect-solutions.png"><img fetchpriority="high" decoding="async" src="https://sourcedcode.com/wp-content/uploads/2024/11/adobes-redirect-solutions.png" alt="Adobe's Supported AEMaaCS Redirect Solutions" width="1642" height="872" class="alignnone size-full wp-image-7524" srcset="https://sourcedcode.com/wp-content/uploads/2024/11/adobes-redirect-solutions.png 1642w, https://sourcedcode.com/wp-content/uploads/2024/11/adobes-redirect-solutions-300x159.png 300w, https://sourcedcode.com/wp-content/uploads/2024/11/adobes-redirect-solutions-1024x544.png 1024w, https://sourcedcode.com/wp-content/uploads/2024/11/adobes-redirect-solutions-768x408.png 768w, https://sourcedcode.com/wp-content/uploads/2024/11/adobes-redirect-solutions-1536x816.png 1536w, https://sourcedcode.com/wp-content/uploads/2024/11/adobes-redirect-solutions-600x319.png 600w" sizes="(max-width: 1642px) 100vw, 1642px" /></a></p>
<hr class="spacer-large"/>
<h2 id="background_redirect_map_manager_vs_redirect_manager_in_aemaacs">Background: Redirect Map Manager vs. Redirect Manager in AEMaaCS</h2>
<p>Previously, <strong>ACS Commons Redirect Map Manager</strong> was unsupported on AEMaaCS, limiting options for handling redirects. As a workaround, customers needed to use <strong>ACS Commons Redirect Manager</strong>, which came with several challenges:</p>
<ul>
<li><strong>Reliance on Dispatcher Rules</strong>: Redirect Manager required that all redirect requests pass through the Dispatcher’s rules to reach the AEM publishers, where Redirect Manager rules could then be executed. This dependency on Dispatcher configurations often led to complications. Only requests meeting specific Dispatcher criteria reached the publisher, and requests blocked by earlier Dispatcher rules (e.g., rules for file types or specific paths) would bypass the publisher entirely, causing some redirects to fail.</li>
<li><strong>Potential for Conflicting Rules</strong>: Dispatcher has its own rewrite rules, which can sometimes interfere with redirects set in Redirect Manager. If a Dispatcher rewrite rule processes a request before it reaches Redirect Manager, it can override the redirect, leading to unexpected behaviors or even redirect loops. This makes troubleshooting and coordinating rules more challenging.</li>
<li><strong>Increased Maintenance and Complexity</strong>: Coordinating Dispatcher rules with Redirect Manager required ongoing adjustments to ensure consistency across both levels. This setup added maintenance overhead, as new rules or configurations in the Dispatcher required verification to avoid interfering with existing redirects.</li>
</ul>
<p>With <strong>AEM version <a href="https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/release-notes/maintenance/2024/2024-10-0?lang=en#18311" rel="noopener" target="_blank">18311</a></strong> and the support for <strong>ACS Commons Redirect Map Manager</strong>, these limitations are greatly reduced. Redirect Map Manager now allows redirect processing to be handled entirely at the edge by the Dispatcher, minimizing reliance on AEM publishers and aligning with Adobe’s best practices for cloud environments.</p>
<hr class="spacer-large"/>
<h2 id="key_benefits_of_the_new_setup">Key Benefits of the New Setup</h2>
<h3>1. Offloading Redirects to the Dispatcher</h3>
<p>With <strong>ACS Commons Redirect Map Manager</strong>, redirect processing is managed at the Dispatcher level, reducing the need for requests to be handled by publishers. This shift improves performance and scalability:</p>
<ul>
<li><strong>Previous Configuration with Redirect Manager</strong>: The first request for a redirect had to be processed by the AEM publisher, placing load on the AEM instance until CDN caching took effect. For high-traffic sites, this dependency on the publisher created potential performance bottlenecks.</li>
<li><strong>New Configuration with Redirect Map Manager</strong>: Redirects are processed directly by the Dispatcher, with CDN caching supporting subsequent requests. This reduces publisher load and improves response times, allowing for smoother handling of large-scale redirects.</li>
</ul>
<h3>2. Simplified Management with Fewer Conflicts</h3>
<p>Redirect Map Manager reduces the likelihood of conflicts with Apache’s Dispatcher rewrite rules:</p>
<ul>
<li><strong>Better Coordination with Dispatcher Rules</strong>: With redirect processing fully managed at the Dispatcher, Redirect Map Manager rules are less likely to conflict with existing rewrite rules, eliminating the need to pass through complex Dispatcher configurations to reach the publisher.</li>
<li><strong>Reduced Complexity</strong>: Redirect Map Manager’s edge-based handling simplifies redirect rule management, enabling more consistent behavior and reducing the need for Dispatcher-publisher coordination.</li>
</ul>
<h3>3. Greater Flexibility for Business Users</h3>
<p>This update provides a more accessible and flexible redirection setup for business users who need to control redirects but may lack access to development pipelines:</p>
<ul>
<li><strong>User-Friendly Management Interface</strong>: ACS Commons Redirect Map Manager offers an intuitive interface within AEM for managing redirects. Business users can easily create, edit, and organize large numbers of redirects without requiring deployments or extensive pipeline configurations.</li>
<li><strong>Scalability for Large-Scale Operations</strong>: Redirect Map Manager supports thousands of redirects directly within AEM, making it ideal for business-driven redirect management at scale.</li>
</ul>
<hr class="spacer-large"/>
<h2 id="how_to_configure_pipeline_free_url_redirects_with_redirect_map_manager">How to Configure Pipeline-Free URL Redirects with Redirect Map Manager</h2>
<p>Setting up pipeline-free redirects with the ACS Commons Redirect Map Manager in AEMaaCS is straightforward:</p>
<ol>
<li><strong>Define Redirect Maps</strong>: In the <span class="code-highlight-secondary">managed-rewrite-maps.yaml</span> file, specify paths to redirect files stored in the publish repository.</li>
<li><strong>Manage Redirects in Redirect Map Manager</strong>: Use the Redirect Map Manager’s user interface to set up and organize redirect mappings. The tool’s UI allows direct integration with Dispatcher for a streamlined process.</li>
<li><strong>Configure Apache RewriteMap</strong>:
<ul>
<li>Set up the <span class="code-highlight-secondary">RewriteMap</span> directive in Apache to ensure optimal redirect caching and performance at the Dispatcher level. Here’s a sample configuration:</li>
</ul>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">RewriteMap map.<span style="color: #006633;">foo</span> dbm<span style="color: #339933;">=</span>sdbm<span style="color: #339933;">:/</span>tmp<span style="color: #339933;">/</span>rewrites<span style="color: #339933;">/</span>my.<span style="color: #006633;">map</span><br />
RewriteCond $<span style="color: #009900;">&#123;</span>map.<span style="color: #006633;">foo</span><span style="color: #339933;">:</span>$1<span style="color: #009900;">&#125;</span> <span style="color: #339933;">!</span><span style="color: #0000ff;">&quot;&quot;</span><br />
RewriteRule <span style="color: #339933;">^</span><span style="color: #009900;">&#40;</span>.<span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>$ $<span style="color: #009900;">&#123;</span>map.<span style="color: #006633;">foo</span><span style="color: #339933;">:</span>$1<span style="color: #339933;">|/</span><span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#91;</span>L,R<span style="color: #339933;">=</span><span style="color: #cc66cc;">301</span><span style="color: #009900;">&#93;</span></div></td></tr></tbody></table></div>
</li>
</ol>
<p>For a deeper dive into this feature, visit Adobe’s full article: <a href="https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/content-delivery/pipeline-free-url-redirects" target="_blank" rel="noopener">Pipeline-Free URL Redirects</a>.</p>
<p>Visit the official <a href="https://adobe-consulting-services.github.io/acs-aem-commons/features/redirect-map-manager/index.html" rel="noopener" target="_blank">ACS Commons Redirect Map Manager Page</a>.</p>
<hr class="spacer-large"/>
<h2 id="conclusion">Conclusion</h2>
<p>The introduction of ACS Commons Redirect Map Manager support in AEMaaCS marks a significant improvement in URL redirection management. By handling redirects at the Dispatcher, this feature enhances performance, reduces complexity, and minimizes publisher load, all while aligning with Adobe’s best practices for AEM Cloud environments.</p>
<p>With these changes, managing large-scale redirects in AEMaaCS becomes more efficient, flexible, and scalable, making it easier for teams to maintain high performance and consistency across their AEM implementations.</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/pipeline-free-url-redirects-acs-commons-redirect-map-manager-now-supported-on-aemaacs">Pipeline-Free URL Redirects &#038; ACS Commons Redirect Map Manager Now Supported on AEMaaCS</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/pipeline-free-url-redirects-acs-commons-redirect-map-manager-now-supported-on-aemaacs/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Clear &#038; Flush AEMaaCS Cache After Code Deployment</title>
		<link>https://sourcedcode.com/blog/aem/how-to-clear-flush-aemaacs-cache-after-code-deployment</link>
					<comments>https://sourcedcode.com/blog/aem/how-to-clear-flush-aemaacs-cache-after-code-deployment#respond</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Tue, 13 Aug 2024 04:19:51 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[AEMaaCS]]></category>
		<category><![CDATA[Caching]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=7316</guid>

					<description><![CDATA[<p>Flushing the cache in Adobe Experience Manager as a Cloud Service (AEMaaCS) after a code deployment is a critical step to ensure that users receive the most up-to-date content. Good new for you, AEMaaCS automates much of this process through its rolling deployment strategy, which involves coordinated steps to deploy code, update configurations, and invalidate [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/how-to-clear-flush-aemaacs-cache-after-code-deployment">How to Clear &#038; Flush AEMaaCS Cache After Code Deployment</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Flushing the cache in Adobe Experience Manager as a Cloud Service (AEMaaCS) after a code deployment is a critical step to ensure that users receive the most up-to-date content. Good new for you, AEMaaCS automates much of this process through its rolling deployment strategy, which involves coordinated steps to deploy code, update configurations, and invalidate the Dispatcher cache across all instances.</p>
<div class="mention-block">
    <strong>Quick Links</strong></p>
<ol>
<li><a href="#rolling_deployment_process_in_aemaa_cs">Rolling Deployment Process in AEMaaCS</a></li>
<li><a href="#why_is_this_process_important">Why Is This Process Important?</a></li>
<li><a href="#additional_considerations">Additional Considerations</a></li>
</ol>
</div>
<hr class="spacer-large"/>
<h2 id="rolling_deployment_process_in_aemaa_cs">1. Rolling Deployment Process in AEMaaCS</h2>
<p>During a production deployment, AEMaaCS follows a rolling deployment strategy to minimize downtime and ensure continuous availability. Here’s how it works:</p>
<ol>
<li><strong>Deploy AEM Packages to Author:</strong>
<ul>
<li>The deployment begins by pushing the updated AEM packages to the author instance. This ensures that the author environment is updated first, preparing it for any content authoring that might be needed post-deployment.</li>
</ul>
</li>
<li><strong>Detach Dispatcher1 from the Load Balancer:</strong>
<ul>
<li>The first Dispatcher (dispatcher1) is temporarily removed from the load balancer. This prevents it from serving any requests during the deployment, ensuring that users do not access potentially outdated or unstable content.</li>
</ul>
</li>
<li><strong>Deploy AEM Packages to Publish1 and Dispatcher1:</strong>
<ul>
<li>With dispatcher1 detached, the deployment of AEM packages to the first publish instance (publish1) and the corresponding Dispatcher package to dispatcher1 occurs simultaneously.</li>
<li>After the deployment, the <span class="code-highlight-primary">Dispatcher cache is flushed</span>. This step is critical as it clears the old cache, ensuring that the updated content is served once the Dispatcher is brought back online.</li>
</ul>
</li>
<li><strong>Reattach Dispatcher1 to the Load Balancer:</strong>
<ul>
<li>Once the deployment to publish1 and the cache flush on dispatcher1 are complete, dispatcher1 is added back to the load balancer. It can now serve requests with the updated content and configurations.</li>
</ul>
</li>
<li><strong>Repeat for Dispatcher2:</strong>
<ul>
<li>The process is repeated for the second Dispatcher (dispatcher2). Dispatcher2 is detached from the load balancer, the deployment is made to publish2 and dispatcher2, the <span class="code-highlight-primary">cache is flushed</span>, and then dispatcher2 is reattached to the load balancer.</li>
</ul>
</li>
<li><strong>Continue for All Instances:</strong>
<ul>
<li>This rolling deployment process continues until all publish and Dispatcher instances in the topology have been updated. By updating one Dispatcher at a time, AEMaaCS ensures that there is always at least one Dispatcher available to serve requests, thus maintaining high availability throughout the deployment.</li>
</ul>
</li>
</ol>
<hr class="spacer-large"/>
<h2 id="why_is_this_process_important">2. Why Is This Process Important?</h2>
<p>Flushing the Dispatcher cache after code deployment is essential for ensuring that users receive the latest content and that no outdated files are served. The rolling deployment strategy employed by AEMaaCS automates this process, making it seamless and reducing the risk of downtime or content inconsistencies.</p>
<hr class="spacer-large"/>
<h2 id="additional_considerations">3. Additional Considerations</h2>
<p>While AEMaaCS automates much of the deployment and cache flushing process, it’s important to ensure that your Dispatcher configurations are optimized for this process. Properly configured <span class="code-highlight-primary">.stat</span> files and cache invalidation rules help to ensure that the cache is only flushed when necessary, preserving performance while ensuring content freshness.</p>
<p>For more detailed information on the rolling deployment process and how AEMaaCS handles cache invalidation, refer to the official <a href="https://experienceleague.adobe.com/en/docs/experience-manager-cloud-manager/content/using/code-deployment" target="_blank" rel="noopener">Adobe Experience Manager documentation</a> .</p>
<p>This step-by-step approach ensures a smooth transition during code deployments, keeping your AEM environment optimized and responsive.</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/how-to-clear-flush-aemaacs-cache-after-code-deployment">How to Clear &#038; Flush AEMaaCS Cache After Code Deployment</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/how-to-clear-flush-aemaacs-cache-after-code-deployment/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Speed Up Unit Tests in JUnit 5 AEM Projects with SLF4J-NOP</title>
		<link>https://sourcedcode.com/blog/aem/how-to-speed-up-unit-tests-in-junit-5-aem-projects-with-slf4j-nop</link>
					<comments>https://sourcedcode.com/blog/aem/how-to-speed-up-unit-tests-in-junit-5-aem-projects-with-slf4j-nop#respond</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Wed, 07 Aug 2024 12:12:18 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[AEMaaCS]]></category>
		<category><![CDATA[JUNIT]]></category>
		<category><![CDATA[JUNIT4]]></category>
		<category><![CDATA[JUNIT5]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=7304</guid>

					<description><![CDATA[<p>Optimizing the performance of unit tests in AEM projects is crucial for maintaining efficient development cycles. One effective method to achieve this is by disabling logging during test execution using the slf4j-nop library. Here&#8217;s why and how you can implement it, along with some performance benchmarks. Quick Links Why Disable Logs During Unit Tests? Adding [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/how-to-speed-up-unit-tests-in-junit-5-aem-projects-with-slf4j-nop">How to Speed Up Unit Tests in JUnit 5 AEM Projects with SLF4J-NOP</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Optimizing the performance of unit tests in AEM projects is crucial for maintaining efficient development cycles. One effective method to achieve this is by disabling logging during test execution using the <strong>slf4j-nop</strong> library. Here&#8217;s why and how you can implement it, along with some performance benchmarks.</p>
<div class="mention-block">
    <strong>Quick Links</strong></p>
<ol>
<li><a href="#why_disable_logs_during_unit_tests">Why Disable Logs During Unit Tests?</a></li>
<li><a href="#adding_slf4j_nop_to_your_project">Adding slf4j-nop to Your Project</a></li>
<li><a href="#benchmarks_and_examples">Benchmarks and Examples</a></li>
<li><a href="#further_optimizing_aem_tests">Further Optimizing AEM Tests</a></li>
</ol>
</div>
<hr class="spacer-large"/>
<h2 id="why_disable_logs_during_unit_tests">1. Why Disable Logs During Unit Tests?</h2>
<p>Logging during unit tests can add unnecessary overhead, especially in large projects where tests generate extensive logs. While logging is essential in production and development environments for debugging, it offers little value during unit tests where the focus is on verifying the correctness of isolated components. Disabling logs during tests provides several benefits:</p>
<ul>
<li><span class="code-highlight-primary">Reduced I/O Overhead:</span> Logging operations require I/O, which can slow down test execution. Disabling logging eliminates this overhead, leading to faster tests.</li>
<li><span class="code-highlight-primary">Cleaner Test Output:</span> With logs disabled, test outputs are cleaner, making it easier to focus on test results without the distraction of log entries.</li>
<li><span class="code-highlight-primary">Improved Test Performance:</span> Benchmarks have shown that disabling logs can significantly speed up test execution.</li>
</ul>
<hr class="spacer-large"/>
<h2 id="adding_slf4j_nop_to_your_project">2. Adding slf4j-nop to Your Project</h2>
<p>To disable logging, you can add the <span class="code-highlight-primary">slf4j-nop</span> dependency to your <span class="code-highlight-primary">pom.xml</span>:</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;</span>dependency<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>groupId<span style="color: #339933;">&gt;</span>org.<span style="color: #006633;">slf4j</span><span style="color: #339933;">&lt;/</span>groupId<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>artifactId<span style="color: #339933;">&gt;</span>slf4j<span style="color: #339933;">-</span>nop<span style="color: #339933;">&lt;/</span>artifactId<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>version<span style="color: #339933;">&gt;</span>20.0.16<span style="color: #339933;">&lt;/</span>version<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>scope<span style="color: #339933;">&gt;</span>test<span style="color: #339933;">&lt;/</span>scope<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;/</span>dependency<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<p>For multi-module AEM projects, ensure this dependency is also included in the <span class="code-highlight-primary">core/pom.xml</span> file.</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;</span>dependency<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>groupId<span style="color: #339933;">&gt;</span>org.<span style="color: #006633;">slf4j</span><span style="color: #339933;">&lt;/</span>groupId<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>artifactId<span style="color: #339933;">&gt;</span>slf4j<span style="color: #339933;">-</span>nop<span style="color: #339933;">&lt;/</span>artifactId<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>scope<span style="color: #339933;">&gt;</span>test<span style="color: #339933;">&lt;/</span>scope<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;/</span>dependency<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<p><a href="https://mvnrepository.com/artifact/org.slf4j/slf4j-nop" rel="noopener" target="_blank">https://mvnrepository.com/artifact/org.slf4j/slf4j-nop</a></p>
<hr class="spacer-large"/>
<h2 id="benchmarks_and_examples">3. Benchmarks and Examples</h2>
<p>Here’s a comparison of test execution times to illustrate the impact of disabling logs:</p>
<ul>
<li>JUnit 5 (with logging):
<ul>
<li>Run from IntelliJ IDEA: 9.276 seconds</li>
<li>Run with mvn clean test: 8.696 seconds</li>
</ul>
</li>
<li>JUnit 5 (with slf4j-nop):
<ul>
<li>Run from IntelliJ IDEA: <span class="code-highlight-primary">2.116 seconds</span></li>
<li>Run with mvn clean test: <span class="code-highlight-primary">1.892 seconds</span></li>
</ul>
</li>
</ul>
<p>These results clearly demonstrate that disabling logging can drastically reduce test execution times, allowing for faster feedback during development.</p>
<hr class="spacer-large"/>
<h2 id="further_optimizing_aem_tests">4. Further Optimizing AEM Tests</h2>
<p>In addition to disabling logging, further optimization can be achieved by selecting the appropriate <span class="code-highlight-primary">AemContext</span>:</p>
<ul>
<li><span class="code-highlight-primary">NoResourceResolverTypeAemContext (Fastest):</span> Ideal for tests that don&#8217;t require resource resolution.</li>
<li><span class="code-highlight-primary">ResourceResolverMockAemContext (Default):</span> Best for tests that need a mocked resource resolver.</li>
<li><span class="code-highlight-primary">JcrMockAemContext:</span> Useful for tests requiring JCR features like indexing.</li>
<li><span class="code-highlight-primary">JcrOakAemContext (Slowest):</span> Necessary for simulating a full JCR, though it’s the slowest option.</li>
</ul>
<p>By combining these strategies—disabling unnecessary logging and selecting the appropriate context—you can achieve significantly faster and more efficient unit tests.</p>
<p>Implementing these strategies ensures your unit tests are optimized, allowing you to maintain high development velocity without being slowed down by lengthy test runs.</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/how-to-speed-up-unit-tests-in-junit-5-aem-projects-with-slf4j-nop">How to Speed Up Unit Tests in JUnit 5 AEM Projects with SLF4J-NOP</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/how-to-speed-up-unit-tests-in-junit-5-aem-projects-with-slf4j-nop/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Serving New Client Library CSS and JS After Release on AEM as a Cloud Service (AEMaaCS)</title>
		<link>https://sourcedcode.com/blog/aem/serving-new-client-library-css-and-js-after-release-on-aem-as-a-cloud-service-aemaacs</link>
					<comments>https://sourcedcode.com/blog/aem/serving-new-client-library-css-and-js-after-release-on-aem-as-a-cloud-service-aemaacs#respond</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Wed, 31 Jul 2024 06:25:19 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[AEMaaCS]]></category>
		<category><![CDATA[Caching]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=7232</guid>

					<description><![CDATA[<p>How does new client library code for JS and CSS gets served in my AEMaaCS website after development, staging, production release, and how does the correct version of the client libs are being used on AEMaaCS? Ensuring that users receive the latest updates—such as new client libraries (CSS and JS)—requires a carefully managed caching strategy. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/serving-new-client-library-css-and-js-after-release-on-aem-as-a-cloud-service-aemaacs">Serving New Client Library CSS and JS After Release on AEM as a Cloud Service (AEMaaCS)</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>How does new client library code for JS and CSS gets served in my AEMaaCS website after development, staging, production release, and how does the correct version of the client libs are being used on AEMaaCS?</p>
<p>Ensuring that users receive the latest updates—such as new client libraries (CSS and JS)—requires a carefully managed caching strategy. This article explores how cache invalidation is handled upon releasing new code, particularly clientlibs, and uses the Adobe WKND project as an example to explain the process.</p>
<div class="mention-block">
    <strong>Quick Links</strong></p>
<ol>
<li><a href="#introduction">Introduction</a></li>
<li><a href="#automatic_cache_invalidation_how_it_works">Automatic Cache Invalidation: How It Works</a></li>
<li><a href="#example_configuration_adobe_wknd_project">Example Configuration: Adobe WKND Project</a></li>
<li><a href="#breakdown_of_the_configuration">Breakdown of the Configuration</a></li>
<li><a href="#key_mechanisms_and_timings">Key Mechanisms and Timings</a></li>
<li><a href="#conclusion">Conclusion</a></li>
</ol>
</div>
<hr class="spacer-large"/>
<h2 id="introduction">1. Introduction</h2>
<p>In this article, we will step through how typically an AEMaaCS website serves newly released client-libraries JS and CSS to users, and we will take a look at the <a href="https://github.com/adobe/aem-guides-wknd/blob/33aa8fda2defe45a6c8c8607ead0026e1492ff01/dispatcher/src/conf.d/available_vhosts/wknd.vhost#L158" rel="noopener" target="_blank">Adobe WKND project</a> as an example.</p>
<hr class="spacer-large"/>
<h2 id="automatic_cache_invalidation_how_it_works">2. Automatic Cache Invalidation: How It Works</h2>
<p>Upon releasing new client libraries, AEMaaCS uses versioned clientlibs. This involves adding a unique hash (previous understanding of the hash generated is pretty much converting the entire minified CSS and JS into <a href="https://adobe-consulting-services.github.io/acs-aem-commons/features/versioned-clientlibs/index.html" rel="noopener" target="_blank">MD5 Hash &#8211; ACS Commons Approach</a>) to the filenames of clientlibs, served on newly fresh requested HTML pages from the AEM publishers, which forces the CDN and browser caches to recognize and fetch the new files. This automatic mechanism helps ensure that users are served the updated versions. </p>
<p>And please keep in mind, it&#8217;s the fresh uncached version of the AEM .html pages who actually serves the path of the versioned clientlibs files. Lets understand .html are cached invalidated from the dispatcher and CDN cache.</p>
<p>Examples of hashed client libs:<br />
/etc.clientlibs/settings/wcm/designs/gandalf/clientlibs/css/all.en-us.min.LIHASHed376af2042959edf283b2591e37eff9.css
</p>
<hr class="spacer-large"/>
<h2 id="example_configuration_adobe_wknd_project">3. Example Configuration: Adobe WKND Project</h2>
<p>In this article, we will purely inspect the <a href="https://github.com/adobe/aem-guides-wknd/blob/33aa8fda2defe45a6c8c8607ead0026e1492ff01/dispatcher/src/conf.d/available_vhosts/wknd.vhost#L158" rel="noopener" target="_blank">Adobe WKND project</a> which is production live code examples of recommended rules for cache invalidating .html files. The following configuration from the WKND project shows how HTML pages are handled in terms of caching:</p>
<div class="codecolorer-container apache default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="apache codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">&lt;<span style="color: #000000; font-weight:bold;">LocationMatch</span> <span style="color: #7f007f;">&quot;^/content/.*<span style="color: #000099; font-weight: bold;">\.</span>html$&quot;</span>&gt;<br />
&nbsp; &nbsp; <span style="color: #00007f;">Header</span> unset Cache-Control<br />
&nbsp; &nbsp; <span style="color: #00007f;">Header</span> always set Cache-Control <span style="color: #7f007f;">&quot;max-age=300,stale-while-revalidate=3600&quot;</span> <span style="color: #7f007f;">&quot;expr=%{REQUEST_STATUS} &lt; 400&quot;</span><br />
&nbsp; &nbsp; <span style="color: #00007f;">Header</span> always set Surrogate-Control <span style="color: #7f007f;">&quot;stale-while-revalidate=43200,stale-if-error=43200&quot;</span> <span style="color: #7f007f;">&quot;expr=%{REQUEST_STATUS} &lt; 400&quot;</span><br />
&nbsp; &nbsp; <span style="color: #00007f;">Header</span> set Age <span style="color: #ff0000;">0</span><br />
&lt;/<span style="color: #000000; font-weight:bold;">LocationMatch</span>&gt;</div></td></tr></tbody></table></div>
<hr class="spacer-large"/>
<h2 id="breakdown_of_the_configuration">4. Breakdown of the Configuration</h2>
<p>1. <strong> LocationMatch, Targeting HTML Pages:</strong></p>
<p>&#8211; The configuration applies to all HTML pages under the <span class="code-highlight-primary">/content/</span> path.</p>
<p>2. <strong>Cache-Control Settings:</strong></p>
<ul>
<li><span class="code-highlight-primary">max-age=300</span>: HTML pages are cached for 5 minutes. During this time, the CDN serves the cached content without checking with the origin server.</li>
<li><span class="code-highlight-primary">stale-while-revalidate=3600</span>: After 5 minutes, if a request is made, the CDN serves the stale content and fetches a new version from the server in the background. This background fetch happens within 1 hour, ensuring minimal disruption.</li>
</ul>
<p>3. <strong>Surrogate-Control for CDN:</strong></p>
<ul>
<li><span class="code-highlight-primary">stale-while-revalidate=43200</span>: The CDN can continue serving stale content while fetching fresh content for up to 12 hours.</li>
<li><span class="code-highlight-primary">stale-if-error=43200</span>: In the event of errors fetching the new content, the CDN serves stale content for up to 12 hours.</li>
</ul>
<p>4. <strong>Age Header:</strong></p>
<p>&#8211; <span class="code-highlight-primary">Header set Age 0</span>: This resets the age of the content to zero, indicating that it is freshly cached.</p>
<hr class="spacer-large"/>
<h2 id="key_mechanisms_and_timings">5. Key Mechanisms and Timings</h2>
<p><strong>Initial Cache Period (<span class="code-highlight-primary">max-age=300</span>):</strong></p>
<p>&#8211; For the first 300 seconds (5 minutes) after the content is cached, the CDN serves the cached version without rechecking with the origin server.</p>
<p><strong>Stale-While-Revalidate (<span class="code-highlight-primary">stale-while-revalidate=3600</span>):</strong></p>
<p>&#8211; After 5 minutes, the <span class="code-highlight-primary">max-age</span> period expires, if a user requests the content, the CDN serves the stale (cached) content immediately and fetches a new version from the origin server in the background. This mechanism ensures that users receive immediate responses, even if the content is slightly outdated, while the cache is refreshed in the background. And again, <em style="color:red;">it&#8217;s the fresh uncached version of the AEM .html pages who actually serves the path of the versioned clientlibs files, which is why invalidation on the HTML file is important here.</em></p>
<p><strong>After Stale-While-Revalidate:</strong></p>
<p>&#8211; If a new version has not been successfully fetched within the <span class="code-highlight-primary">stale-while-revalidate</span> window (up to 1 hour), and another request is made, the CDN serves the most recently cached version while attempting to fetch the new version again.</p>
<hr class="spacer-large"/>
<h2 id="conclusion">6. Conclusion</h2>
<p>The correct dispatcher configurations ensures that new client libraries and other updates are served efficiently. The HTML pages need to reference the new clientlibs versioned paths to reflect the latest updates. Since the WKND configuration sets HTML page caching to a maximum of 5 minutes with additional revalidation periods, the new HTML pages and associated clientlibs may not appear immediately; after 5 minutes, if a user requests the content, the CDN serves the stale (cached) content immediately and fetches a new version from the origin server in the background. This mechanism ensures that users receive immediate responses, even if the content is slightly outdated, while the cache is refreshed in the background, the <span class="code-highlight-primary">stale-while-revalidate</span> directive helps ensure users see updated content with minimal disruption. This setup minimizes the impact of cache misses and ensures that updated content is available without noticeable delay to the user. This well-balanced approach allows for efficient content delivery while maintaining a seamless user experience.</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/serving-new-client-library-css-and-js-after-release-on-aem-as-a-cloud-service-aemaacs">Serving New Client Library CSS and JS After Release on AEM as a Cloud Service (AEMaaCS)</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/serving-new-client-library-css-and-js-after-release-on-aem-as-a-cloud-service-aemaacs/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Set AEM Local Environment and Secret Variables AEMaaCS</title>
		<link>https://sourcedcode.com/blog/aem/set-aem-local-environment-and-secret-variables-aemaacs</link>
					<comments>https://sourcedcode.com/blog/aem/set-aem-local-environment-and-secret-variables-aemaacs#comments</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Thu, 30 Mar 2023 00:39:10 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[AEMaaCS]]></category>
		<category><![CDATA[Development]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=4545</guid>

					<description><![CDATA[<p>As an AEM developer developing for the AEMaaCS SDK, it&#8217;s essential to have a local environment properly set up for development purposes. You may encounter environment-specific and secret variables in your OSGI configuration files. As an AEM developer trying to familiarize new features of the AEMaaCS SDK development environment, setting up environment-specific and secret variables [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/set-aem-local-environment-and-secret-variables-aemaacs">Set AEM Local Environment and Secret Variables AEMaaCS</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>As an AEM developer developing for the AEMaaCS SDK, it&#8217;s essential to have a local environment properly set up for development purposes. You may encounter environment-specific and secret variables in your OSGI configuration files. As an AEM developer trying to familiarize new features of the AEMaaCS SDK development environment, setting up environment-specific and secret variables is non-trivial at first. Once you have done it once, it will be much easier to move forward. </p>
<p>In this article, I will show you how to set up environment-specific and secret variables. If you would like to understand when to use environment-specific and secret variables effectively, check out the official AEM Adobe git documentation. At the end of this article, you are equipped to run your AEM local development environment with environment-specific and secret variables!</p>
<p>One last thing, it looks like only AEMaaCS SDK has environment-specific and secret variables feature enabled for OSGI configurations.</p>
<hr class="spacer-large"/>
<h5>Examples of what OSGI configurations would look like with environment and secret variables set in your code base:</h5>
<p><strong>Environment-specific variable</strong><br />
high-level use-case: Values that are specific to a particular environment and may vary between different development environments cannot be targeted accurately by run mode, as AEMaaCS only has a single development run mode. For instance:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;$[env:SERVER_API_URL]&quot;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p><strong>Secret variable</strong><br />
high-level use-case: Sensitive information, such as confidential data or authentication credentials, should not be stored in Git repositories due to security concerns. For instance:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #3366CC;">&quot;api-key&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;$[secret:SERVER_API_KEY]&quot;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>Example of an OSGI configuration with the combination of the environment-specific and secret variables being used:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #3366CC;">&quot;connection.timeout&quot;</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">1000</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp;<span style="color: #3366CC;">&quot;api-key&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;$[secret:SERVER_API_KEY]&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp;<span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;$[env:SERVER_API_URL]&quot;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<div class="mention-block">
Please note that environment-specific and secret variables allow defaults, so if your environment is not set up properly with the right configuration, it will use the default settings.</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #3366CC;">&quot;connection.timeout&quot;</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">1000</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp;<span style="color: #3366CC;">&quot;api-key&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;$[secret:SERVER_API_KEY;default=https://api.sourcedcode.com&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #3366CC;">&quot;,<br />
&nbsp; &nbsp;&quot;</span>url<span style="color: #3366CC;">&quot;: &quot;</span>$<span style="color: #009900;">&#91;</span>env<span style="color: #339933;">:</span>SERVER_API_URL<span style="color: #339933;">;</span><span style="color: #000066; font-weight: bold;">default</span><span style="color: #339933;">=</span>23u1kn1jbkjs789fds8f_ewrqasd<span style="color: #009900;">&#93;</span><span style="color: #3366CC;">&quot;<br />
}<br />
From the &lt;a href=&quot;</span>https<span style="color: #339933;">:</span><span style="color: #006600; font-style: italic;">//github.com/AdobeDocs/experience-manager-cloud-service.en/blob/main/help/implementing/deploying/configuring-osgi.md&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;documentation&lt;/a&gt;, it looks like only AEMaaCS has environment-specific and secret variables feature enabled for OSGI configurations.</span></div></td></tr></tbody></table></div>
</div>
<hr class="spacer-large"/>
<p>So how we can actually set these environments and secret variables into AEM? Well, it&#8217;s simple. We will be using a Linux environment to set this up. In the examples below, we will be setting up one environment-specific variable and one secret variable.</p>
<ul>
<li>$[env:SERVER_API_URL]</li>
<li>$[secret:SERVER_API_KEY]</li>
</ul>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #3366CC;">&quot;connection.timeout&quot;</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">1000</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp;<span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;$[env:SERVER_API_URL]&quot;</span><br />
&nbsp; &nbsp;<span style="color: #3366CC;">&quot;api-key&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;$[secret:SERVER_API_KEY]&quot;</span><span style="color: #339933;">,</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<hr class="spacer-large"/>
<h2>1. set AEM Environment variables on local AEM instance</h2>
<ol>
<li>Close down your local AEM environment.</li>
<li>open git bash or terminal.</li>
<li>cd to the AEM folder, where the executable jar file exists.</li>
<li>run <span class="code-highlight-primary">export SERVER_API_URL=https://api.sourcedcode.com</span></li>
<li>run <span class="code-highlight-primary">echo ${SERVER_API_URL}</span>// you should see the environment variable being set as this call will echo out what the environment variable is for SERVER_API_URL.</li>
<li>now restart your local AEM environment.</li>
<li>done.</li>
</ol>
<hr class="spacer-large"/>
<h2>2. set AEM Secret variables on local AEM instance</h2>
<ol>
<li>Close down your local AEM environment.</li>
<li>open git bash or terminal.</li>
<li>cd to the AEM folder, where the executable jar file exists.</li>
<li>run <span class="code-highlight-primary">vim ./crx-quickstart/conf/quickstart.properties</span></li>
<li>add this to the last line <span class="code-highlight-primary">org.apache.felix.configadmin.plugin.interpolation.secretsdir=${sling.home}/secretsdir</span></li>
<li>save in vim.</li>
<li>run <span class="code-highlight-primary">mkdir ./crx-quickstart/secretsdir</span></li>
<li>run <span class="code-highlight-primary">cd ./crx-quickstart/secretsdir</span></li>
<li>run <span class="code-highlight-primary">echo &#8220;23u1kn1jbkjs789fds8f_ewrqasd&#8221; > SERVER_API_KEY</span></li>
<li>repeat the step-9 to add more secret variables into your AEM local environment. run <span class="code-highlight-primary">echo &#8220;secret_value&#8221; > secret_key</span></li>
<li>You may have more than 1 secret variable stored in the secretsdir folder: <a href="https://sourcedcode.com/wp-content/uploads/2023/03/secretsdir.png"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2023/03/secretsdir.png" alt="Example of showing many instances of secret variables declared" width="50%" height="auto" class="alignnone size-full wp-image-4569" srcset="https://sourcedcode.com/wp-content/uploads/2023/03/secretsdir.png 890w, https://sourcedcode.com/wp-content/uploads/2023/03/secretsdir-300x75.png 300w, https://sourcedcode.com/wp-content/uploads/2023/03/secretsdir-768x192.png 768w, https://sourcedcode.com/wp-content/uploads/2023/03/secretsdir-600x150.png 600w" sizes="(max-width: 890px) 100vw, 890px" /></a></li>
<li>now restart your local AEM environment.</li>
<li>done.</li>
</ol>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/set-aem-local-environment-and-secret-variables-aemaacs">Set AEM Local Environment and Secret Variables AEMaaCS</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/set-aem-local-environment-and-secret-variables-aemaacs/feed</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>jackrabbit-filter: Filter root&#8217;s ancestor &#8216;/etc/mobile/groups&#8217;</title>
		<link>https://sourcedcode.com/blog/aem/jackrabbit-filter-filter-roots-ancestor-etc-mobile-groups</link>
					<comments>https://sourcedcode.com/blog/aem/jackrabbit-filter-filter-roots-ancestor-etc-mobile-groups#respond</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Sat, 18 Feb 2023 02:34:20 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[AEMaaCS]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=4381</guid>

					<description><![CDATA[<p>A mobile emulator is a tool used to test how a website or application will appear and function on a mobile device. It allows developers to preview and test their mobile websites or applications without the need for an actual mobile device. There are several mobile emulators available for AEM, such as the iOS Simulator [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/jackrabbit-filter-filter-roots-ancestor-etc-mobile-groups">jackrabbit-filter: Filter root&#8217;s ancestor &#8216;/etc/mobile/groups&#8217;</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>A mobile emulator is a tool used to test how a website or application will appear and function on a mobile device. It allows developers to preview and test their mobile websites or applications without the need for an actual mobile device.</p>
<p>There are several mobile emulators available for AEM, such as the iOS Simulator and Android Emulator. These emulators simulate the functionality and appearance of mobile devices, allowing developers to test their websites or applications as if they were running on an actual device.</p>
<p>In AEM, the &#8220;/etc/mobile/groups&#8221; is a location where mobile groups are created and managed. Mobile groups are used to segment content for different mobile devices, such as smartphones and tablets. They allow you to configure and tailor your website or application for specific devices, optimizing the user experience for each device type.</p>
<p>Using the /etc/mobile/groups feature, you can create and manage different groups of mobile devices, set up rules for device detection, and define content for each group. This allows you to provide a tailored experience for users based on the device they are using.</p>
<p>When I tried to introduce a new mobile emulator under the path of ui.content/../etc/mobile/groups/sourcedcode, I was getting a big error:</p>
<hr />
<p><strong style="color:red">[ERROR]</strong> ValidationViolation: &#8220;jackrabbit-filter: Filter root&#8217;s ancestor &#8216;/etc/mobile/groups&#8217; is not covered by any of the specified dependencies nor a valid root.&#8221;, filePath=META-INF/vault/filter.xml<br />
<strong style="color:orange">[INFO]</strong> ValidationViolation: &#8220;jackrabbit-filter: Found orphaned filter entries: entry with root &#8216;/etc/mobile/groups/sourcedcode'&#8221;</p>
<hr class="spacer-large" />
<h3>Solution</h3>
<p>Under the ui.content/pom.xml it looks like we can add configuration to allow validRoots as a part of the maven build. You can simply add this configuration as a part of the &lt;plugin&gt;, and it should be working as expected.</p>
<p>Keep an eye on the code below, line:16-22.</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">&lt;!-- ====================================================================== --<span style="color: #000000; font-weight: bold;">&gt;</span><br />
&lt;!-- V A U L T &nbsp; P A C K A G E &nbsp; P L U G I N S &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;--<span style="color: #000000; font-weight: bold;">&gt;</span><br />
&lt;!-- ====================================================================== --<span style="color: #000000; font-weight: bold;">&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span>org.apache.jackrabbit<span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span>filevault-package-maven-plugin<span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span>1.1.6<span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;properties<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;cloudManagerTarget<span style="color: #000000; font-weight: bold;">&gt;</span></span>none<span style="color: #000000; font-weight: bold;">&lt;/cloudManagerTarget<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/properties<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;group<span style="color: #000000; font-weight: bold;">&gt;</span></span>com.sourcedcode<span style="color: #000000; font-weight: bold;">&lt;/group<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span>sourcedcode.ui.content<span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;packageType<span style="color: #000000; font-weight: bold;">&gt;</span></span>content<span style="color: #000000; font-weight: bold;">&lt;/packageType<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;accessControlHandling<span style="color: #000000; font-weight: bold;">&gt;</span></span>merge<span style="color: #000000; font-weight: bold;">&lt;/accessControlHandling<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;validatorsSettings<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;jackrabbit-filter<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;options<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;validRoots<span style="color: #000000; font-weight: bold;">&gt;</span></span>/conf,/content,/content/experience-fragments,/content/dam,/etc/mobile/groups<span style="color: #000000; font-weight: bold;">&lt;/validRoots<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/options<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/jackrabbit-filter<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/validatorsSettings<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;dependencies<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span>com.sourcedcode<span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span>sourcedcode.ui.apps<span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span>$<span style="color: #66cc66;">&#123;</span>project.version<span style="color: #66cc66;">&#125;</span><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/dependencies<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #000000; font-weight: bold;">&lt;/plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></div></td></tr></tbody></table></div>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/jackrabbit-filter-filter-roots-ancestor-etc-mobile-groups">jackrabbit-filter: Filter root&#8217;s ancestor &#8216;/etc/mobile/groups&#8217;</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/jackrabbit-filter-filter-roots-ancestor-etc-mobile-groups/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to login to AEMaaCS Local Publish crx/de system/console</title>
		<link>https://sourcedcode.com/blog/aem/how-to-login-to-aemaacs-local-publish-crx-de-system-console</link>
					<comments>https://sourcedcode.com/blog/aem/how-to-login-to-aemaacs-local-publish-crx-de-system-console#comments</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Wed, 15 Feb 2023 23:49:14 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[AEMaaCS]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=4370</guid>

					<description><![CDATA[<p>As an AEM developer working in the AEMaaCS environment, it&#8217;s common to need to run AEMaaCS local author and publish while developing in your local environment. Typically, authenticating into the AEMaaCS local author environment is straightforward, but accessing the AEMaaCS local publish environment requires some additional steps. The AEMaaCS local publish environment runs on port [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/how-to-login-to-aemaacs-local-publish-crx-de-system-console">How to login to AEMaaCS Local Publish crx/de system/console</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>As an AEM developer working in the AEMaaCS environment, it&#8217;s common to need to run AEMaaCS local author and publish while developing in your local environment. Typically, authenticating into the AEMaaCS local author environment is straightforward, but accessing the AEMaaCS local publish environment requires some additional steps. </p>
<p>The AEMaaCS local publish environment runs on port 4503, and the security settings are configured by default to align with AEMaaCS setup. If you need to debug the AEMaaCS local publish environment, it&#8217;s important to authenticate into the environment, especially for accessing crx/de and system/console.</p>
<p>In this article, we will guide you through the process of authenticating into the AEMaaCS local publish environment.</p>
<hr class="spacer-large" />
<h3>To access the crx/de and system/console for your AEM publish environment, follow these simple steps:</h3>
<ol>
<li>Open your web browser and go to <a href="http://localhost:4503/libs/granite/core/content/login.html" rel="noopener" target="_blank">http://localhost:4503/libs/granite/core/content/login.html</a>.</li>
<li>Enter the username <b>&#8220;admin&#8221;</b> and the password <b>&#8220;admin&#8221;</b>.</li>
<li>Once you have successfully logged in, you can navigate to the <b>crx/de</b> and <b>system/console</b> environment.</li>
<li>Visit crx/de: <a href="http://localhost:4503/crx/de/index.jsp" rel="noopener" target="_blank">http://localhost:4503/crx/de/index.jsp</a></li>
<li>Visit system/console: <a href="http://localhost:4503/system/console/bundles" rel="noopener" target="_blank">http://localhost:4503/system/console/bundles</a>
</ol>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/how-to-login-to-aemaacs-local-publish-crx-de-system-console">How to login to AEMaaCS Local Publish crx/de system/console</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/how-to-login-to-aemaacs-local-publish-crx-de-system-console/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
