<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Prabhjeet Singh</title>
    <description>The latest articles on DEV Community by Prabhjeet Singh (@prabhjeet6).</description>
    <link>https://dev.to/prabhjeet6</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F408694%2Ff58bc56a-29b0-4ce0-8730-40269f1be811.jpg</url>
      <title>DEV Community: Prabhjeet Singh</title>
      <link>https://dev.to/prabhjeet6</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/prabhjeet6"/>
    <language>en</language>
    <item>
      <title>Understanding Quarkus: Rethinking Java for Cloud-Native Applications</title>
      <dc:creator>Prabhjeet Singh</dc:creator>
      <pubDate>Wed, 04 Mar 2026 10:55:56 +0000</pubDate>
      <link>https://dev.to/prabhjeet6/understanding-quarkus-rethinking-java-for-cloud-native-applications-199n</link>
      <guid>https://dev.to/prabhjeet6/understanding-quarkus-rethinking-java-for-cloud-native-applications-199n</guid>
      <description>&lt;p&gt;Here is my naive attempt at explaining  Quarkus and its ecosystem. In the &lt;a href="https://dev.to/prabhjeet6/quarkus-vs-spring-performance-developer-experience-and-production-trade-offs-part-1-41c9"&gt;previous post&lt;/a&gt;, we discussed what caused the need of a different approach to java web applications.&lt;/p&gt;

&lt;p&gt;Before we begin, I want to clarify, that by no means, I mean to impose Quarkus' preference over Spring Boot. Infact, I get amazed by Spring internals, their design philosophy and seamless developer experience. Spring remains the primary choice for various usecases. &lt;/p&gt;

&lt;p&gt;One such example is Monoliths and long-running services where initial startup time is less critical than sustained high throughput and stability over extended periods. &lt;/p&gt;

&lt;p&gt;Also, Spring remains a developer's top choice, owning to convenience and large ecosystem while Quarkus ecosystem is small but growing. &lt;/p&gt;

&lt;p&gt;Now let's comeback to the topic.&lt;/p&gt;

&lt;p&gt;Here, you will be introduced to CDI. &lt;/p&gt;

&lt;p&gt;CDI stands for &lt;strong&gt;Contexts and Dependency Injection&lt;/strong&gt;. It is  a standard Jakarta EE (formerly Java EE) specification that simplifies the development of complex applications and ensures object lifecycle management. Please refer &lt;a href="https://jakarta.ee/learn/docs/jakartaee-tutorial/current/cdi/cdi-basic/cdi-basic.html" rel="noopener noreferrer"&gt;here&lt;/a&gt; for more.&lt;/p&gt;

&lt;p&gt;While both CDI and the Spring IoC container manage bean lifecycles and dependencies, they differ fundamentally in their underlying philosophy and technical implementation.&lt;/p&gt;

&lt;p&gt;CDI is a specification which specifies a set of APIs that different vendors implement. Spring IoC on the other hand is a proprietary framework. &lt;/p&gt;

&lt;p&gt;Quarkus uses a hybrid approach and implements its Dependency Injection framework on top of CDI. It is known as &lt;strong&gt;ArC&lt;/strong&gt;. Refer &lt;a href="https://quarkus.io/guides/cdi-reference" rel="noopener noreferrer"&gt;this&lt;/a&gt; for more.     &lt;/p&gt;

&lt;p&gt;ArC is designed for build time analysis. This design choice is central to the Quarkus philosophy of moving as much processing as possible from runtime to build time to achieve extremely fast startup times and low memory usage. &lt;/p&gt;

&lt;p&gt;Let's see what does that imply. &lt;/p&gt;

&lt;p&gt;The entire dependency graph is analyzed and resolved during the build process and not at application startup. &lt;/p&gt;

&lt;p&gt;Instead of using runtime reflection, ArC generates static proxies and direct bytecode invocations during the build, significantly reducing memory overhead and startup time.&lt;/p&gt;

&lt;p&gt;This is enough if you want Quarkus to run in JVM mode, but, Quarkus has the option to go beyond build time analysis for optimizations and choose native mode if startup time is critical for an app. &lt;/p&gt;

&lt;p&gt;Quarkus supports native mode. To accomplish this, it uses &lt;a href="https://www.graalvm.org/" rel="noopener noreferrer"&gt;GraalVM.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you compile to a native binary via GraalVM, all unused code is removed through ahead-of-time(AOT) compilation. &lt;/p&gt;

&lt;p&gt;AOT compilation is a technique where your application's source code or bytecode is translated into native machine code before the program is run, typically during the build phase.&lt;/p&gt;

&lt;p&gt;It is efficient in comparison to traditional Just in time(JIT) compilation where bytecode is translated to machine code at runtime.&lt;/p&gt;

&lt;p&gt;Even though GraalVM's static world assumption is wonderful. At times, it may not be enough. Let's  understand it with an example.&lt;/p&gt;

&lt;p&gt;In JVM mode, reflection works normally.&lt;br&gt;
In Native mode, reflection metadata must be known at build time.&lt;/p&gt;

&lt;p&gt;Below is a CustomEvent class. when an event is received by the consumer, the json string message will need to be parsed to CustomEvent object using ObjectMapper, which requires reflection usage. GraalVM won't be able to use reflection at runtime.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class CustomEvent {
    public String name;
    public String email;

    // No-args constructor is required for reflection
    public CustomEvent() {}  
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To handle runtime failures due to reflection, we annotate the above class with &lt;code&gt;@RegisterForReflection&lt;/code&gt;, which works fine with a substrate JVM and complete JVM is not needed.&lt;/p&gt;

&lt;p&gt;We can safely say, that life comes full circle with GraalVM. Bytecode was introduced to replace native binaries as they were platform dependent and   bytecode introduced platform independence. With GraalVM, we go back to native binaries as performance is crucial in cloud platforms.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://microprofile.io/" rel="noopener noreferrer"&gt;Eclipse MicroProfile&lt;/a&gt; is a set of open-source specifications designed to extend Jakarta EE specifically for microservices. In Quarkus, these specifications are implemented primarily via the &lt;a href="https://smallrye.io/" rel="noopener noreferrer"&gt;SmallRye Project&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now, why are microprofile or smallrye needed?&lt;/p&gt;

&lt;p&gt;Quarkus uses Smallrye implementations of microprofile specifications to make their features available to use on its platform.&lt;/p&gt;

&lt;p&gt;The list of projects that Smallrye implements can be seen &lt;a href="https://smallrye.io/projects/" rel="noopener noreferrer"&gt;here&lt;/a&gt;. SmallRye implements the MicroProfile specifications (Config, Health, Fault Tolerance)&lt;/p&gt;

&lt;p&gt;Below is example of Spring REST&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@RestController
@RequestMapping("/hello")
public class GreetingController {
    @GetMapping("/{name}")
    public String greet(@PathVariable String name) {
        return "Hello " + name;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Below is example of Jakarta REST(Formerly JAX-RS), which is Quarkus Equivalent of above. Refer &lt;a href="https://jakarta.ee/learn/docs/jakartaee-tutorial/current/websvcs/rest/rest.html" rel="noopener noreferrer"&gt;here&lt;/a&gt; for documentation. &lt;br&gt;
Please note, Jakarta REST is a specification which RestEasy Reactive implements which is used by Quarkus.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Path("/hello") // This makes it a REST controller
public class GreetingResource {
    @GET
    @Path("/{name}")
    public String greet(@PathParam("name") String name) {
        return "Hello " + name;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Though, SmallRye implements Eclipse Microprofile for Health, Metrics and Fault tolerance. RestEasy is used to implement Jakarta REST. In order to glue them together, we use &lt;strong&gt;RestEasy Rest Client.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Below is an example of Its usage, this can be understood analogous to Feign Client's usage in Spring.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@RegisterRestClient(configKey = "user-api")
public interface UserService {

    @GET
    @Path("/users")
    @Retry(maxRetries = 3, delay = 200) // &amp;lt;--- MicroProfile Fault Tolerance!
    @Fallback(fallbackMethod = "getCachedUsers") // &amp;lt;--- Fallback if all retries fail
    List&amp;lt;User&amp;gt; getByRole(@QueryParam("role") String role);

    // Default response if the external service is down
    default List&amp;lt;User&amp;gt; getCachedUsers(String role) {
        return List.of(new User("Offline User"));
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Below is an example of Spring bean creation of a class present in the classpath, and not in project source code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Configuration //@Configuration is a stereotype behind the scenes.
public class MyConfig {
    @Bean
    public ExternalService externalService() {
        return new ExternalService();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now Here is an  Quarkus equivalent of the above example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@ApplicationScoped // Just a quarkus equivalent of a Spring stereotype 
public class MyProducers {
    @Produces
    @ApplicationScoped // The scope of the bean being created
    public ExternalService externalService() {
        return new ExternalService();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now Let's mention some trivia. Below are some analogies to make working with Quarkus a little familiar.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Spring Annotations&lt;/th&gt;
&lt;th&gt;Quarkus Annotations&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@Autowired&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;@Inject&lt;/code&gt; &lt;code&gt;@Context&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;@Component&lt;/code&gt; &lt;code&gt;@Service&lt;/code&gt; &lt;code&gt;@Repository&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;@ApplicationScoped&lt;/code&gt;&lt;code&gt;@Singleton&lt;/code&gt; &lt;code&gt;@RequestScoped&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@Value("${...}")&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;@ConfigProperty(name="...")&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@Bean&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;@Produces&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;While I feel it is already too much to pack in, I would like to touch upon a few other points.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://vertx.io/" rel="noopener noreferrer"&gt;Vert.x&lt;/a&gt; is an open-source, event-driven, and non-blocking toolkit for building reactive applications on the JVM.&lt;br&gt;
Vert.x is the underlying reactive engine for Qaurkus. Refer guides on &lt;a href="https://quarkus.io/guides/getting-started-reactive" rel="noopener noreferrer"&gt;Introduction for Quarkus Reactive&lt;/a&gt; and &lt;a href="https://quarkus.io/guides/quarkus-reactive-architecture" rel="noopener noreferrer"&gt;reactive architecture&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The single line above has too much to cover. Let's understand this with a few examples.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Kafka traditionally uses a Java client that performs long-polling, which is also a blocking operation.&lt;br&gt;
&lt;strong&gt;The Client:&lt;/strong&gt; Quarkus uses the Vert.x Kafka Client. This is a non-blocking wrapper of the Kafka protocol designed to run on the event loop.&lt;br&gt;
&lt;strong&gt;The Bridge:&lt;/strong&gt; &lt;em&gt;SmallRye Reactive Messaging&lt;/em&gt; sits on top of this Vert.x client. It uses Vert.x to handle the actual TCP connections and heartbeats to the Kafka brokers.&lt;br&gt;
&lt;strong&gt;The Engine's Job:&lt;/strong&gt; Vert.x manages the continuous stream of bytes from Kafka topics. It dispatches these as "events" to your &lt;code&gt;@Incoming&lt;/code&gt; methods. Because it's Vert.x, you can process thousands of Kafka records simultaneously without spawning thousands of threads. &lt;br&gt;
Refer &lt;a href="https://quarkus.io/guides/messaging#:~:text=Execution%20Model,support%20guide%20for%20more%20information." rel="noopener noreferrer"&gt;here&lt;/a&gt; for more details.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Standard Hibernate (ORM) uses JDBC, which is fundamentally blocking—one thread per database connection. In a reactive app, this would kill the event loop. &lt;br&gt;
&lt;strong&gt;The Driver:&lt;/strong&gt; &lt;em&gt;Hibernate Reactive&lt;/em&gt; replaces JDBC with Vert.x Reactive SQL Clients (like &lt;em&gt;vertx-pg-client&lt;/em&gt; for Postgres).&lt;br&gt;
&lt;strong&gt;The Execution:&lt;/strong&gt; When you call session.persist(entity), Hibernate translates your Java object into a SQL query and hands it to the Vert.x SQL client.&lt;br&gt;
&lt;strong&gt;The Engine's Job:&lt;/strong&gt; Vert.x sends the SQL over the network using non-blocking I/O. It doesn't wait for the DB to respond; it immediately releases the thread. When the data eventually comes back, Vert.x triggers the callback that Mutiny then turns back into your result.&lt;br&gt;
Refer &lt;a href="https://vertx.io/docs/howtos/hibernate-reactive-howto/" rel="noopener noreferrer"&gt;vert.x&lt;/a&gt; and &lt;a href="https://quarkus.io/guides/hibernate-reactive" rel="noopener noreferrer"&gt;quarkus&lt;/a&gt; docs for details on the topic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Vert.x EventLoop basically runs a thread to execute requests Non blockingly, and any tasks that need to wait are passed on to worker threads. This improves concurrent performance. Mutiny is a wrapper framework to execute non blocking I/O.&lt;br&gt;
Spring Equivalent for Vert.x EventLoop is Project Reactor, differs slightly in design philosophy with an additional layer and different concurrency strategy.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To conclude, what is Spring's answer to Quarkus?&lt;/p&gt;

&lt;p&gt;Spring has introduced a project called Spring AOT to improve performance in cloud native environments. &lt;/p&gt;

&lt;p&gt;While Quarkus was built cloud first, Spting's images are slightly heavier as it was a project retrofitted to support cloud environments, poles apart from their autoconfiguration magic.&lt;/p&gt;

&lt;p&gt;Finally, I hope you find it useful. Happy learning!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>quarkus</category>
      <category>springboot</category>
    </item>
    <item>
      <title>Why Quarkus?</title>
      <dc:creator>Prabhjeet Singh</dc:creator>
      <pubDate>Tue, 24 Feb 2026 10:15:00 +0000</pubDate>
      <link>https://dev.to/prabhjeet6/quarkus-vs-spring-performance-developer-experience-and-production-trade-offs-part-1-41c9</link>
      <guid>https://dev.to/prabhjeet6/quarkus-vs-spring-performance-developer-experience-and-production-trade-offs-part-1-41c9</guid>
      <description>&lt;p&gt;Since the advent of Spring Boot, it has been the De-Facto Backend Framework for Java Web Developers, thanks to its Developer friendly ecosystem, Autoconfiguration Magic and  ready to code setup (Spring starters). &lt;/p&gt;

&lt;p&gt;But, This is the age of cloud. Several other frameworks have mushroomed up, such as Micronaut and Quarkus.&lt;/p&gt;

&lt;p&gt;We will talk about Quarkus, how is it different from Spring Boot, how cloud has made companies to rethink their strategy of choosing the framework, and what is Spring's answer to Quarkus.&lt;/p&gt;

&lt;p&gt;For me, Quarkus was difficult. Despite Quarkus having similar &lt;a href="https://code.quarkus.io/" rel="noopener noreferrer"&gt;ready to code setup&lt;/a&gt;, similar style of writing code, there was far less developer support and exhaustive documentation when compared to that of Spring boot's detailed documentation and other online forums.&lt;/p&gt;

&lt;p&gt;Spring uses reflection heavily for autoconfiguration. It provides amazing developer experience. &lt;/p&gt;

&lt;p&gt;Stereotypes, Component Scan, Configuration Classes declaring beans for classes outside the container using &lt;code&gt;@Bean&lt;/code&gt;, Spring Data JPA interfaces, You name it, All of these are autoconfigured using reflection. Spring creates proxies at runtime to setup the Spring Container. This results in high usage of RAM and slower application startup.&lt;/p&gt;

&lt;p&gt;To relate to this, lets go through a small example.&lt;br&gt;
You might have seen &lt;code&gt;BeanCreationException&lt;/code&gt; during Spring application start up , refer &lt;a href="https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/beans/factory/BeanCreationException.html" rel="noopener noreferrer"&gt;here&lt;/a&gt; for official documentation. This exception can occur due to variety of reasons. The main crux of the issue remains that Spring tries to resolve all the dependencies and create Beans in their respective scopes at application startup. &lt;/p&gt;

&lt;p&gt;This can help you understand that Spring Beans are created at runtime, when the Application Context initialization is attempted. &lt;/p&gt;

&lt;p&gt;But, the objects are created at runtime, why is that a problem?&lt;/p&gt;

&lt;p&gt;Imagine a jar file that is included in your project's  classpath and is not part of Spring container. You use &lt;code&gt;@Bean&lt;/code&gt; to create a Spring bean. Behind the scenes, a proxy class is created at runtime, whose object is created and used by the Spring Container.&lt;/p&gt;

&lt;p&gt;Let's take another example, you create an interface extending &lt;code&gt;JPARepository&amp;lt;T&amp;gt;&lt;/code&gt;, and it magically provides implementations of multiple methods without a single line of code. How does that work in reality?&lt;/p&gt;

&lt;p&gt;Well, again a Proxy class is created at runtime which actually implements those methods.&lt;/p&gt;

&lt;p&gt;What does it tell you about Spring?&lt;/p&gt;

&lt;p&gt;It tells us that Spring has a high memory footprint and that it is slow as Spring's runtime is computation heavy. Lets understand, why is it a problem.&lt;/p&gt;

&lt;p&gt;Organizations have been moving to Microservices architecture because of its Reliability and Scalability. Systems are moving to cloud environments, reducing costs compared to On Premises Infrastructure and plenty of out of the box options for various use cases that these systems may need.&lt;/p&gt;

&lt;p&gt;A monolith is divided into multiple microservices based on domain driven design principles. Each microservice has multiple replica instances and  each replica gets its own computing and memory resources.&lt;/p&gt;

&lt;p&gt;Imagine a system where hundreds, if not thousands of microservices run on cloud, each pod consumes memory and computing resources, the cloud bill increases multifold.&lt;/p&gt;

&lt;p&gt;Now imagine an Alternative that is approximately 10x faster on average and uses 1/10th of memory resources, saves a ton of money, the trade off is Developer experience. This is what Quarkus brings to the table.&lt;/p&gt;

&lt;p&gt;Here we discussed briefly how Spring works internally, what challenges does it face when integrating with cloud.&lt;/p&gt;

&lt;p&gt;In the next part, we will discuss as to how Quarkus solves the cloud challenge and what Spring's team is doing to mitigate the same.  &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>quarkus</category>
      <category>springboot</category>
    </item>
    <item>
      <title>Deploy Angular SSR Application on AWS</title>
      <dc:creator>Prabhjeet Singh</dc:creator>
      <pubDate>Thu, 04 Nov 2021 21:00:15 +0000</pubDate>
      <link>https://dev.to/prabhjeet6/deploy-angular-ssr-application-on-aws-b9n</link>
      <guid>https://dev.to/prabhjeet6/deploy-angular-ssr-application-on-aws-b9n</guid>
      <description>&lt;p&gt;This post illustrates deployment process of Server Side Rendered Angular application, as can be guessed from the title.&lt;/p&gt;

&lt;p&gt;Though, AWS has a dedicated service for deploying SSR applications, called  &lt;em&gt;AWS Amplify&lt;/em&gt;, but, as of writing this post, Angular Universal is not supported by &lt;em&gt;Amplify&lt;/em&gt;. There are multiple other options available to achieve the required result. One of the more popular ones were the usage of a third party API, called &lt;em&gt;Serverless&lt;/em&gt;. But, It was particularly challenging for me to find a clean and vanilla solution as I was juggling between different options.&lt;/p&gt;

&lt;p&gt;Below, I will demonstrate the usage of &lt;strong&gt;AWS Elastic Beanstalk&lt;/strong&gt; to deploy &lt;strong&gt;Angular SSR.&lt;/strong&gt;     &lt;/p&gt;

&lt;p&gt;Open &lt;em&gt;AWS Management Console&lt;/em&gt; and go to &lt;em&gt;Elastic Beanstalk&lt;/em&gt; homepage. Click on Create Application.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr73hcujnw6b7c4pgvc2z.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr73hcujnw6b7c4pgvc2z.PNG" alt=" " width="800" height="161"&gt;&lt;/a&gt;&lt;br&gt;
Next, Give your application a name and click on &lt;em&gt;Create&lt;/em&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F19tumcco3wmtrixklg16.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F19tumcco3wmtrixklg16.PNG" alt=" " width="800" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The console will need an environment, on which the application will run. Click on  &lt;em&gt;Create one now&lt;/em&gt; and subsequently select &lt;em&gt;Web server environment&lt;/em&gt; as demonstrated below. &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg5r9dlcavd2qdoa961wv.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg5r9dlcavd2qdoa961wv.PNG" alt=" " width="800" height="207"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9sw8ugepzvp5ek4jqhvh.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9sw8ugepzvp5ek4jqhvh.PNG" alt=" " width="800" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, select Platform and Platform branch for the application and environment created above. Refer to below image for the same. &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzuhm22oz56n7x3qvp1v3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzuhm22oz56n7x3qvp1v3.png" alt=" " width="800" height="619"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the same page, proceed with uploading the &lt;em&gt;zipped&lt;/em&gt; &lt;strong&gt;dist&lt;/strong&gt; folder of your Angular app which gets generated upon building your app in the local system. Now, click on &lt;em&gt;Configure more options&lt;/em&gt; button. &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frug2xqada5kbinlzmt4b.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frug2xqada5kbinlzmt4b.PNG" alt=" " width="664" height="501"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the next screen, click on the &lt;em&gt;Edit&lt;/em&gt; button on the software tile.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjvechbfwuz7pnfbq8i5s.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjvechbfwuz7pnfbq8i5s.PNG" alt=" " width="800" height="190"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;Provide the Node Command considering &lt;strong&gt;dist&lt;/strong&gt; as root. The path used in Node Command generally is of the folder where file to be run is placed.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffsu98gr7o9suy7gy39l7.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffsu98gr7o9suy7gy39l7.PNG" alt=" " width="800" height="311"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Save the Configuration and click on Create App subsequently. Environment setup will take a few minutes, after which it will provide the Health status, logs and Deployment URL, as, can be seen below.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh67iaufucl4pg1gq7igl.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh67iaufucl4pg1gq7igl.PNG" alt=" " width="800" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hope, This article is useful for the readers. Please share and provide reactions if you like the blog.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>node</category>
      <category>angularssr</category>
      <category>elasticbeanstalk</category>
    </item>
    <item>
      <title>AWS Lambda Basics: Part 2</title>
      <dc:creator>Prabhjeet Singh</dc:creator>
      <pubDate>Mon, 15 Mar 2021 21:47:22 +0000</pubDate>
      <link>https://dev.to/prabhjeet6/aws-lambda-basics-part-2-1301</link>
      <guid>https://dev.to/prabhjeet6/aws-lambda-basics-part-2-1301</guid>
      <description>&lt;p&gt;In the &lt;a href="https://dev.to/prabhjeet6/aws-lambda-basics-part-2-1301"&gt;previous post&lt;/a&gt;, We explored the usage of AWS Lambda console. Here, we will discuss the actual implementation of Lambda Function for our use case, that is, thumbnail Generation from videos stored in S3.&lt;br&gt;
Project repository can be found &lt;a href="https://github.com/prabhjeet6/ThumbnailGenerationLambda" rel="noopener noreferrer"&gt;here&lt;/a&gt; for reference .    &lt;/p&gt;

&lt;p&gt;You use a deployment package to deploy your function code to Lambda. Lambda supports two types of deployment packages: container images and .zip files or jar files.&lt;/p&gt;

&lt;p&gt;Lambda provides the following libraries for Java functions:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;com.amazonaws:aws-lambda-java-core&lt;/strong&gt; (required) – Defines handler method interfaces and the context object that the runtime passes to the handler. If you define your own input types, this is the only library that you need.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;com.amazonaws:aws-lambda-java-events&lt;/strong&gt; – Input types for events from services that invoke Lambda functions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;com.amazonaws:aws-lambda-java-log4j2&lt;/strong&gt; – An appender library for Apache Log4j 2 that you can use to add the request ID for the current invocation to your function logs.&lt;/p&gt;

&lt;p&gt;Below are the Maven dependencies for these libraries with latest versions as of writing this post. Add these to pom file of Maven project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  &amp;lt;dependencies&amp;gt;
    &amp;lt;dependency&amp;gt;
      &amp;lt;groupId&amp;gt;com.amazonaws&amp;lt;/groupId&amp;gt;
      &amp;lt;artifactId&amp;gt;aws-lambda-java-core&amp;lt;/artifactId&amp;gt;
      &amp;lt;version&amp;gt;1.2.1&amp;lt;/version&amp;gt;
    &amp;lt;/dependency&amp;gt;
    &amp;lt;dependency&amp;gt;
      &amp;lt;groupId&amp;gt;com.amazonaws&amp;lt;/groupId&amp;gt;
      &amp;lt;artifactId&amp;gt;aws-lambda-java-events&amp;lt;/artifactId&amp;gt;
      &amp;lt;version&amp;gt;3.1.0&amp;lt;/version&amp;gt;
    &amp;lt;/dependency&amp;gt;
    &amp;lt;dependency&amp;gt;
      &amp;lt;groupId&amp;gt;com.amazonaws&amp;lt;/groupId&amp;gt;
      &amp;lt;artifactId&amp;gt;aws-lambda-java-log4j2&amp;lt;/artifactId&amp;gt;
      &amp;lt;version&amp;gt;1.2.0&amp;lt;/version&amp;gt;
    &amp;lt;/dependency&amp;gt;
  &amp;lt;/dependencies&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Building a deployment package with Maven
&lt;/h5&gt;

&lt;p&gt;To build a deployment package with Maven, use the Maven Shade plugin. The plugin creates a &lt;strong&gt;JAR file that contains the compiled function code and all of its dependencies&lt;/strong&gt; . Maven dependency for the plugin is below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      &amp;lt;plugin&amp;gt;
        &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;
        &amp;lt;artifactId&amp;gt;maven-shade-plugin&amp;lt;/artifactId&amp;gt;
        &amp;lt;version&amp;gt;3.2.2&amp;lt;/version&amp;gt;
        &amp;lt;configuration&amp;gt;
          &amp;lt;createDependencyReducedPom&amp;gt;false&amp;lt;/createDependencyReducedPom&amp;gt;
        &amp;lt;/configuration&amp;gt;
        &amp;lt;executions&amp;gt;
          &amp;lt;execution&amp;gt;
            &amp;lt;phase&amp;gt;package&amp;lt;/phase&amp;gt;
            &amp;lt;goals&amp;gt;
              &amp;lt;goal&amp;gt;shade&amp;lt;/goal&amp;gt;
            &amp;lt;/goals&amp;gt;
          &amp;lt;/execution&amp;gt;
        &amp;lt;/executions&amp;gt;
      &amp;lt;/plugin&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you use the appender library (aws-lambda-java-log4j2), you must also configure a transformer for the Maven Shade plugin. The transformer library combines versions of a cache file that appear in both the appender library and in Log4j.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;plugin&amp;gt;
        &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;
        &amp;lt;artifactId&amp;gt;maven-shade-plugin&amp;lt;/artifactId&amp;gt;
        &amp;lt;version&amp;gt;3.2.2&amp;lt;/version&amp;gt;
        &amp;lt;configuration&amp;gt;
          &amp;lt;createDependencyReducedPom&amp;gt;false&amp;lt;/createDependencyReducedPom&amp;gt;
        &amp;lt;/configuration&amp;gt;
        &amp;lt;executions&amp;gt;
          &amp;lt;execution&amp;gt;
            &amp;lt;phase&amp;gt;package&amp;lt;/phase&amp;gt;
            &amp;lt;goals&amp;gt;
              &amp;lt;goal&amp;gt;shade&amp;lt;/goal&amp;gt;
            &amp;lt;/goals&amp;gt;
            &amp;lt;configuration&amp;gt;
              &amp;lt;transformers&amp;gt;
                &amp;lt;transformer implementation="com.github.edwgiz.maven_shade_plugin.log4j2_cache_transformer.PluginsCacheFileTransformer"&amp;gt;
                &amp;lt;/transformer&amp;gt;
              &amp;lt;/transformers&amp;gt;
            &amp;lt;/configuration&amp;gt;
          &amp;lt;/execution&amp;gt;
        &amp;lt;/executions&amp;gt;
        &amp;lt;dependencies&amp;gt;
          &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;com.github.edwgiz&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;maven-shade-plugin.log4j2-cachefile-transformer&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;2.13.0&amp;lt;/version&amp;gt;
          &amp;lt;/dependency&amp;gt;
        &amp;lt;/dependencies&amp;gt;
      &amp;lt;/plugin&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To build the deployment package, use the &lt;code&gt;mvn package&lt;/code&gt; command. It will generate JAR file in target directory.&lt;/p&gt;

&lt;p&gt;The AWS Lambda function handler is the method in your function code that processes events. When your function is invoked, Lambda runs the handler method. When the handler exits or returns a response, it becomes available to handle another event.&lt;/p&gt;

&lt;h5&gt;
  
  
  Handler interfaces
&lt;/h5&gt;

&lt;p&gt;The &lt;em&gt;aws-lambda-java-core&lt;/em&gt; library defines two interfaces for handler methods. Use the provided interfaces to simplify handler configuration and validate the handler method signature at compile time.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;com.amazonaws.services.lambda.runtime.RequestHandler&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;com.amazonaws.services.lambda.runtime.RequestStreamHandler&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;em&gt;RequestHandler&lt;/em&gt; interface is a generic type that takes two parameters: the input type and the output type. Both types must be objects. When you use this interface, the Java runtime deserializes the event into an object with the input type, and serializes the output into text. Use this interface when the built-in serialization works with your input and output types.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Handler value: example.Handler
public class Handler implements RequestHandler&amp;lt;Map&amp;lt;String,String&amp;gt;, String&amp;gt;{
  @Override
  public String handleRequest(Map&amp;lt;String,String&amp;gt; event, Context context)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To use your own serialization, implement the RequestStreamHandler interface. With this interface, Lambda passes your handler an input stream and output stream. The handler reads bytes from the input stream, writes to the output stream, and returns void.&lt;/p&gt;

&lt;h5&gt;
  
  
  Conclusion
&lt;/h5&gt;

&lt;p&gt;AWS SDK for Java should be explored as per your use case and requirements. Also, There are advanced topics besides these like layers for AWS Lambda for further exploration.&lt;/p&gt;

&lt;p&gt;Thanks for your time. Please share and provide reactions if you like the blog.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>java</category>
    </item>
    <item>
      <title>AWS Lambda Basics: Part 1</title>
      <dc:creator>Prabhjeet Singh</dc:creator>
      <pubDate>Mon, 15 Mar 2021 17:17:08 +0000</pubDate>
      <link>https://dev.to/prabhjeet6/aws-lambda-basics-4pb6</link>
      <guid>https://dev.to/prabhjeet6/aws-lambda-basics-4pb6</guid>
      <description>&lt;p&gt;Usage of Cloud Computing services for Software development has been on the rise in the recent years, given its cost effectiveness due to economies of scale and the flexibility it provides in capacity utilization. &lt;/p&gt;

&lt;p&gt;AWS provides services for various use cases and requirements. AWS Lambda is one such service. Here, we will discuss it with the help of an example.&lt;/p&gt;

&lt;p&gt;AWS Lambda is a serverless compute service that lets you run code without provisioning or managing servers, creating workload-aware cluster scaling logic, maintaining event integrations, or managing runtimes. AWS Lambda can be categorized as &lt;em&gt;Platform as a Service(PaaS)&lt;/em&gt; or more specifically as &lt;em&gt;Function as a Service(FaaS)&lt;/em&gt;  as it delivers a framework for developers that they can build upon and use to create customized applications.  &lt;/p&gt;

&lt;p&gt;Lambda runs your code on a high-availability compute infrastructure and performs all of the administration of the compute resources, It is highly scalable, and significantly reduces the development effort for your use case. &lt;/p&gt;

&lt;p&gt;In simple words, Lambda is &lt;em&gt;event driven service&lt;/em&gt;, and can be &lt;em&gt;triggered&lt;/em&gt; in response to changes due to concerned event and do not require CPU resources to be manually managed to invoke it whenever such event occurs. &lt;/p&gt;

&lt;p&gt;Lambda supports multiple runtimes, which can be found &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;br&gt;
We will use &lt;strong&gt;Java 8&lt;/strong&gt; as runtime for our purpose. In Our example, whenever a video is uploaded in a AWS S3 &lt;em&gt;(Simple Storage Service)&lt;/em&gt; bucket, the Lambda function is invoked which generates a thumbnail image for it and stores it in another bucket. You can find the source code in the &lt;a href="https://github.com/prabhjeet6/ThumbnailGenerationLambda" rel="noopener noreferrer"&gt;repository&lt;/a&gt; for reference. &lt;/p&gt;

&lt;p&gt;Please note, AWS S3 is a service which provides cheap secondary storage on cloud. &lt;/p&gt;

&lt;p&gt;On AWS Lambda Console, click on Create Function&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fimc2bpnpvgpoqs9lrvco.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fimc2bpnpvgpoqs9lrvco.PNG" alt="Alt Text" width="800" height="130"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the next screen, give Function name, choose runtime of your choice and create execution role. Lambda creates an execution role by default, with permission to upload logs to Amazon CloudWatch Logs.&lt;/p&gt;

&lt;p&gt;Please note, Amazon CloudWatch collects monitoring and operational data in the form of logs, metrics, and events, and visualizes it using automated dashboards.&lt;/p&gt;

&lt;p&gt;For our example, We create a role beforehand via IAM Console, and &lt;em&gt;Use an existing role&lt;/em&gt; option and choose the already created IAM role from dropdown.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm181ab0q97paje6piolk.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm181ab0q97paje6piolk.PNG" alt="Alt Text" width="800" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To be able to select an existing role for above, create an IAM role through IAM Console beforehand. &lt;/p&gt;

&lt;p&gt;Click on &lt;em&gt;Roles&lt;/em&gt; link in IAM console as below. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdzlpqf9fsvzu29gslr9x.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdzlpqf9fsvzu29gslr9x.PNG" alt="Alt Text" width="800" height="193"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on create Role&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvs8fbiklfu8szvar7b9a.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvs8fbiklfu8szvar7b9a.PNG" alt="Alt Text" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, choose &lt;em&gt;Lambda&lt;/em&gt; as Use Case and click on &lt;em&gt;Next:Permissions&lt;/em&gt; as highlighted below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg9l86pazm78hnyqr8vei.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg9l86pazm78hnyqr8vei.PNG" alt="Alt Text" width="800" height="595"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Complete the forms that follow. For our purpose, the role will comprise below policies. &lt;em&gt;AWSS3FullAccess&lt;/em&gt; policy allows Lambda to observe when a read/write event occurs in S3.&lt;em&gt;CloudWatchFullAccess&lt;/em&gt; policy enables to upload logs to CloudWatch whenever Lambda Function is invoked.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5bjwu1zjn5jzucb5clel.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5bjwu1zjn5jzucb5clel.PNG" alt="Alt Text" width="800" height="74"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on &lt;em&gt;+Add trigger&lt;/em&gt; from below and select S3 from drop down that follows. After the trigger is added, Upload the source code as jar file from Upload button under Code tab as highlighted below.     &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1djy2mc1pf0v827lpbzq.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1djy2mc1pf0v827lpbzq.PNG" alt="Alt Text" width="800" height="355"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Handler function as highlighted above, has the syntax &lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;package&amp;gt;.&amp;lt;class&amp;gt;::&amp;lt;HandlerFunction&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Under Test Tab, create a &lt;strong&gt;Mock event&lt;/strong&gt; of &lt;strong&gt;S3-put&lt;/strong&gt; Type from the drop down list. A JSON Body will come up, which is passed to Lambda Function as a &lt;strong&gt;mock input&lt;/strong&gt;, Modify the input JSON body and update &lt;em&gt;awsRegion&lt;/em&gt;, bucket's &lt;em&gt;name&lt;/em&gt;, &lt;em&gt;arn&lt;/em&gt; and object's  &lt;em&gt;key&lt;/em&gt; as below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbuz642nkkto000iornty.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbuz642nkkto000iornty.PNG" alt="Alt Text" width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on Invoke button. The Test event is triggered and success/failure logs are generated in AWS CloudWatch.&lt;/p&gt;

&lt;p&gt;This gives us basic understanding of working with AWS Lambda Console. Actual Implementation of the Lambda Function will be covered in a separate blog.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/prabhjeet6/aws-lambda-basics-part-2-1301"&gt;Click here&lt;/a&gt; for part 2 of the blog post. &lt;/p&gt;

</description>
      <category>aws</category>
      <category>java</category>
      <category>lambda</category>
    </item>
    <item>
      <title>Angular i18n and Server Side Rendering with Angular Universal: Part 2</title>
      <dc:creator>Prabhjeet Singh</dc:creator>
      <pubDate>Fri, 04 Sep 2020 15:40:20 +0000</pubDate>
      <link>https://dev.to/prabhjeet6/server-side-rendering-with-angular-universal-3fjd</link>
      <guid>https://dev.to/prabhjeet6/server-side-rendering-with-angular-universal-3fjd</guid>
      <description>&lt;p&gt;In the &lt;a href="https://dev.to/prabhjeet6/angular-i18n-and-server-side-rendering-40bo"&gt;previous post&lt;/a&gt;, we discussed, Angular's &lt;em&gt;localize package&lt;/em&gt; and how we can run separate locale configurations. &lt;/p&gt;

&lt;p&gt;Here, we will discuss  Angular Universal, a technology that renders Angular applications on the server and how it helps  angular app to be accessible in different sub-directories, depending on the language.&lt;/p&gt;

&lt;p&gt;First, we run the below CLI command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng add @nguniversal/express-engine --clientProject=demoproject
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, clientProject is our existing Angular application.This command generates server-side app module, app.server.module.ts and &lt;strong&gt;Express web server, server.ts&lt;/strong&gt; . This web server is used to decide, as to which locale will be rendered for a particular request.   &lt;/p&gt;

&lt;p&gt;Next, We modify the Express web server to add the following code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.get('*', (req, res) =&amp;gt; {
//this is for i18n
  const supportedLocales = ['en', 'pa',...];//supported Locales 
  const defaultLocale = 'en';
  const matches = req.url.match(/^\/([a-z]{2}(?:-[A-Z]{2})?)\//);

  //check if the requested url has a correct format '/locale' and matches any of the supportedLocales
  const locale = (matches &amp;amp;&amp;amp; supportedLocales.indexOf(matches[1]) !== -1) ? matches[1] : defaultLocale;

  res.render(`${locale}/index`, { req });
});

// Start up the Node server
app.listen(PORT, () =&amp;gt; {
  console.log(`Node Express server listening on http://localhost:${PORT}`);
});

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Through this modification, web server identifies the locale of the request, and renders the response accordingly.&lt;/p&gt;

&lt;p&gt;You will notice that, in &lt;em&gt;angular.json&lt;/em&gt;,  &lt;strong&gt;server Configurations&lt;/strong&gt; is automatically added once you run &lt;code&gt;ng add @nguniversal/express-engine&lt;/code&gt; command, which looks like below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"server": {
          "builder": "@angular-devkit/build-angular:server",
          "options": {
            "outputPath": "dist/server",
            "main": "src/main.server.ts",
            "tsConfig": "src/tsconfig.server.json"
          },
          "configurations": {
            "production": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ]
            },"pa-Guru": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ]
            },
            "en-US": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ]
            }
          }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In &lt;em&gt;package.json&lt;/em&gt;, add/modify below scripts according to your project to build and render all locales of your app.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"compile:server": "webpack --config webpack.server.config.js --progress --colors",
    "serve:ssr": "node dist/server",
    "build:ssr": "npm run build:client-and-server-bundles &amp;amp;&amp;amp; npm run compile:server",
    "build:client-and-server-bundles": "ng build --configuration=pa-Guru &amp;amp;&amp;amp; ng build --configuration=en-US  &amp;amp;&amp;amp; ng run demoproject:server:production  &amp;amp;&amp;amp;  ng run demoproject:server:en-US &amp;amp;&amp;amp;  ng run demoproject:server:pa-Guru"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, you can run the following command on Angular CLI to render locales through express server and change locales on runtime, depending on the request Url's baseHref.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run build:ssr &amp;amp;&amp;amp; npm run serve:ssr
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Benefits of using  Server Side Rendering
&lt;/h1&gt;

&lt;p&gt;Search Engines and  social media sites rely on web crawlers to index your application content and make that content searchable on the web. These web crawlers may be unable to navigate and index your highly interactive Angular application as a human user could do.&lt;/p&gt;

&lt;p&gt;Angular Universal can generate a static version of your app that is easily searchable, linkable, and navigable without JavaScript. Universal also makes a site preview available since each URL returns a fully rendered page.&lt;/p&gt;

&lt;p&gt;We serve a static version of the landing page to hold the user's attention. At the same time, we'll load the full Angular app behind it. The user perceives near-instant performance from the landing page and gets the full interactive experience after the full app loads.&lt;/p&gt;

&lt;h1&gt;
  
  
  Motivation for using Angular i18n over other available libraries
&lt;/h1&gt;

&lt;p&gt;First, we look at some of the &lt;strong&gt;disadvantages&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Angular i18n only works with one language at a time, you have to completely reload the application to change the language.&lt;/li&gt;
&lt;li&gt;Angular i18n only supports using i18n in your templates for now.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But, its &lt;strong&gt;Advantages&lt;/strong&gt; overpower the drawbacks.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Angular i18n supports ICU expressions (plurals and select). &lt;/li&gt;
&lt;li&gt;The translation process is well defined, it is easy to detect 
missing translations and you can integrate that in your plans 
before deploying your app (extract, send to translators, merge).&lt;/li&gt;
&lt;li&gt;It scales well, you never look directly at the files since you 
use a software for that, you can translate in x languages, you 
just need to extract once and create the translation files for 
each locale (which your professional tool should do for you)&lt;/li&gt;
&lt;li&gt;It's super efficient because the app is pre-translated when it 
bootstraps, there's no extra work to apply your translations and * It works well with pre-rendering because of that
since you merge the translations at build time, it means that it 
can support directives, components and other html elements, you 
can move them around in the different languages, or even remove 
them if needed&lt;/li&gt;
&lt;li&gt;You don't need to worry about lazy loading, your bundles are 
translated at build time, and that includes your lazy loaded 
modules.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks for your time. Please share and provide reactions if you like the blog.&lt;/p&gt;

</description>
      <category>angular</category>
      <category>npm</category>
    </item>
    <item>
      <title>Angular i18n and Server Side Rendering with Angular Universal:Part 1</title>
      <dc:creator>Prabhjeet Singh</dc:creator>
      <pubDate>Fri, 04 Sep 2020 14:30:33 +0000</pubDate>
      <link>https://dev.to/prabhjeet6/angular-i18n-and-server-side-rendering-40bo</link>
      <guid>https://dev.to/prabhjeet6/angular-i18n-and-server-side-rendering-40bo</guid>
      <description>&lt;p&gt;Internationalization is the need of most modern apps today.If your application is developed in Angular, there are various libraries available, which you can use to present the app in multiple locales and reach out to your audience in various regions of the world.&lt;/p&gt;

&lt;p&gt;Angular provides a module to accomplish the same. However, it is complex in comparison to some of the other libraries available for the purpose, which, you can integrate with your app.&lt;/p&gt;

&lt;p&gt;Here, We will learn as to how we can use Angular i18n and then, we will  reason as to why it should be preferred over other strategies.  &lt;/p&gt;

&lt;p&gt;Use Angular CLI to run below command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng add @angular/localize
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will allow you to use Angular's Localization in your project.&lt;/p&gt;

&lt;p&gt;Next, we mark  static text in template files for translations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;p i18n &amp;gt;Welcome to Angular Internationalization!&amp;lt;/p&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mark element attributes for translations by using i18n-attribute with any attribute of any element. You also can assign a meaning, description, and custom ID with the &lt;em&gt;i18n-attribute="meaning|description@&lt;a class="mentioned-user" href="https://dev.to/id"&gt;@id&lt;/a&gt;"&lt;/em&gt; syntax.&lt;/p&gt;

&lt;p&gt;Below is an example for the same.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;input  type="password" i18n-placeholder ="passwordPlaceholder|Placeholder for Password@@001"  placeholder="password" name="password" /&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Please note that meaning, description and Id are optional, and Angular will auto generate an Id for you, if you don't mention one.&lt;/p&gt;

&lt;p&gt;Angular provides Data transformation pipes that use the LOCALE_ID token to format data according to the locale.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DatePipe: Formats a date value.&lt;/li&gt;
&lt;li&gt;CurrencyPipe: Transforms a number to a currency string.&lt;/li&gt;
&lt;li&gt;DecimalPipe: Transforms a number into a decimal number string.&lt;/li&gt;
&lt;li&gt;PercentPipe: Transforms a number to a percentage string.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To override the value of LOCALE_ID, add the locale parameter, for Example,&lt;code&gt;{{amount | currency : 'en-US'}}&lt;/code&gt;&lt;br&gt;
For a list of available Locales please refer to &lt;a href="https://github.com/angular/angular/tree/master/packages/common/locales" rel="noopener noreferrer"&gt;this.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, that we have prepared templates for translation, we can proceed to process them.&lt;/p&gt;
&lt;h1&gt;
  
  
  Extract Source Language File
&lt;/h1&gt;

&lt;p&gt;Run the below command in Angular CLI.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng xi18n  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a source language file named &lt;em&gt;messages.xlf&lt;/em&gt; in your project's root directory.&lt;br&gt;
The xi18n command can read and write files in three translation formats:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;XLIFF 1.2 (default)&lt;/li&gt;
&lt;li&gt;XLIFF 2&lt;/li&gt;
&lt;li&gt;XML Message Bundle (XMB)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can specify the translation format explicitly with the        &lt;code&gt;--format&lt;/code&gt; command option.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;messages.xlf&lt;/em&gt; looks like below.Notice that, it has  translation units,with an Id generated for it. It also captures other metadata, like file location and line number.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;trans-unit id="7d1069de6c435fab320e5305cbaf139af1b0189f" datatype="html"&amp;gt;
        &amp;lt;source&amp;gt;Welcome!&amp;lt;/source&amp;gt;
        &amp;lt;context-group purpose="location"&amp;gt;
        &amp;lt;context context-type="sourcefile"&amp;gt;app/login/login.component.html&amp;lt;/context&amp;gt;
          &amp;lt;context context-type="linenumber"&amp;gt;23&amp;lt;/context&amp;gt;
        &amp;lt;/context-group&amp;gt;
      &amp;lt;/trans-unit&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Duplicate the &lt;em&gt;messages.xlf&lt;/em&gt; file  for each locale of your interest, and rename it.For example, you can rename it to &lt;em&gt;messages.pa.xlf&lt;/em&gt; for Punjabi Language.&lt;br&gt;&lt;br&gt;
Please note that below code snippet has an additional target tag for translation of the source Language text.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;trans-unit id="7d1069de6c435fab320e5305cbaf139af1b0189f" datatype="html"&amp;gt;
        &amp;lt;source&amp;gt;Welcome!&amp;lt;/source&amp;gt;
        &amp;lt;target&amp;gt; ਜੀ ਆਇਆਂ ਨੂੰ !&amp;lt;/target&amp;gt;
        &amp;lt;context-group purpose="location"&amp;gt;
        &amp;lt;context context-type="sourcefile"&amp;gt;app/login/login.component.html&amp;lt;/context&amp;gt;
          &amp;lt;context context-type="linenumber"&amp;gt;23&amp;lt;/context&amp;gt;
        &amp;lt;/context-group&amp;gt;
      &amp;lt;/trans-unit&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Similarly, add target tags to all translation units, in all the &lt;em&gt;messages.lang.xlf&lt;/em&gt; files, corresponding to the number of languages your app may be supporting.&lt;/p&gt;

&lt;h1&gt;
  
  
  Define Locales in the Configuration
&lt;/h1&gt;

&lt;p&gt;In &lt;em&gt;angular.json&lt;/em&gt; , Under build's &lt;em&gt;Configurations&lt;/em&gt;, define a configuration for each locale.Notice that, &lt;code&gt;en-US&lt;/code&gt; is Locale_ID for English, You can refer &lt;a href="https://github.com/angular/angular/tree/master/packages/common/locales" rel="noopener noreferrer"&gt;here&lt;/a&gt; for other Languages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"en-US": {
              "outputPath": "dist/browser/en",
              "baseHref": "/en/",
              "i18nLocale": "en-US",
              "i18nFormat": "xlf",
              "i18nFile": "src/messages.xlf",
              "i18nMissingTranslation": "error",
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "5mb"
                }
              ]
            }
          }
        },    
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;outputPath&lt;/code&gt; signifies path in the root directory of the Project, &lt;br&gt;
where this build will be generated, once run.Angular i18n supports &lt;code&gt;aot&lt;/code&gt; by default. &lt;code&gt;baseHref&lt;/code&gt; indicates the ref on the website, which loads the locale.&lt;/p&gt;

&lt;p&gt;Similarly, Under &lt;em&gt;angular.json's&lt;/em&gt; , serve Configurations, define serve configs for each locale. Here &lt;code&gt;production&lt;/code&gt; indicates the default, and &lt;code&gt;en-US&lt;/code&gt; indicates application served in English. You should include all the locales your app is supporting. &lt;code&gt;demoproject&lt;/code&gt; is the name of the project here.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"production": {
              "browserTarget": "demoproject:build:production"
            },
            "en-US": {
              "browserTarget": "demoproject:build:en-US"
            },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Please note, that build and serve configurations are defined in &lt;em&gt;angular.json&lt;/em&gt; for each locale, which indicates that, a separate build and deployment will be created and run for each locale.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, you can build and run the application in your desired locale, by  the following command on CLI. Below is an example for Punjabi Language.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng build --configuration=pa-Guru &amp;amp;&amp;amp; ng serve --configuration=pa-Guru

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In case, you want multiple locales to be running in parallel, add the &lt;code&gt;--port&lt;/code&gt; switch with serve command, to serve the app on a different port for a different locale.&lt;/p&gt;

&lt;p&gt;This gives us a basic implementation of Angular i18n, with separate build and deployment for each locale. But,Our goal is to be able to switch the locales from the Url itself. Also, it is important to understand the motivation to pick angular i18n mechanism instead of other simpler available libraries.&lt;/p&gt;

&lt;p&gt;This will be covered in a separate blog post. That is where Server Side Rendering comes into play. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/prabhjeet6/server-side-rendering-with-angular-universal-3fjd"&gt;click here&lt;/a&gt; for Part 2 of the blog post. &lt;/p&gt;

</description>
      <category>angular</category>
      <category>npm</category>
      <category>node</category>
    </item>
  </channel>
</rss>
