<?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: Devanand Ukalkar</title>
    <description>The latest articles on DEV Community by Devanand Ukalkar (@devanandukalkar).</description>
    <link>https://dev.to/devanandukalkar</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%2F796714%2F84d63888-ae84-4ca1-8701-edddb6390b1b.png</url>
      <title>DEV Community: Devanand Ukalkar</title>
      <link>https://dev.to/devanandukalkar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/devanandukalkar"/>
    <language>en</language>
    <item>
      <title>Interacting with AWS S3 using Spring Boot application</title>
      <dc:creator>Devanand Ukalkar</dc:creator>
      <pubDate>Sat, 16 Jul 2022 22:07:50 +0000</pubDate>
      <link>https://dev.to/devanandukalkar/storing-objects-to-aws-s3-with-spring-boot-1h13</link>
      <guid>https://dev.to/devanandukalkar/storing-objects-to-aws-s3-with-spring-boot-1h13</guid>
      <description>&lt;p&gt;When it comes to storing objects (files, images..), there are multiple options to choose from. Should I go with keeping files on same/different server as that of application or in database as a BLOB or persist path as record on DB? What about scalability, maintenance, resiliency, decoupling etc.? &lt;/p&gt;

&lt;p&gt;With increasing popularity of cloud computing services like storage, fortunately we don't have to worry about all of these anymore. AWS Simple Storage Service (S3) is one of such popular services that you can use to resolve your data storage concerns.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Introduction to AWS S3:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Amazon S3 (Simple Storage Service) is a scalable, high-speed, low-cost web-based service designed for online backup and archiving of data and application programs. It allows to upload, store, and download any type of files up to 5 TB in size. The subscriber has control over the accessibility of data, i.e. privately/publicly accessible.&lt;/p&gt;

&lt;p&gt;AWS provides SDKs to manage your objects programmatically. Let's look at steps to get started.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First and foremost thing that you need is AWS account.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Access keys to gain access to storage using AWS storage APIs. You can either use AWS root account's or IAM user account's access keys. Checkout below image to see where these keys are available.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go to Security Credentials and click on Create Access Key.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fvd20r4u64z2xyc9605xg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fvd20r4u64z2xyc9605xg.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fs4p8ziunhstgf8t8a6qt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fs4p8ziunhstgf8t8a6qt.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fahp6xtf9gvw7i3oqhqei.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fahp6xtf9gvw7i3oqhqei.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search for S3 and create a bucket with all default values for now.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fdu80qjwyai7voca83a4m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fdu80qjwyai7voca83a4m.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need to select AWS S3 region of your choice where you would like to store the data. Please be aware that region affects your AWS bill. More details are available &lt;a href="https://aws.amazon.com/s3/pricing/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's enough setup for AWS S3 bucket, let's move on to Spring boot part of this article and get hands dirty with some coding.&lt;/p&gt;




&lt;p&gt;I will be using IntelliJ IDEA for this project with Spring Initiliazr plugin &amp;amp; Maven as build tool.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a new project and choose "Spring Initiliazr" from Generators section.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2F7a1guwf3wqco1oe9v75w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F7a1guwf3wqco1oe9v75w.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Specify project properties as per your need and create project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2F1dkggjmt360io0djjtfe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F1dkggjmt360io0djjtfe.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add AWS S3 SDK dependency in pom.xml. There are few other dependencies needed for this project. GitHub repository link is shared at the end of this article.&lt;/li&gt;
&lt;/ul&gt;

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

&amp;lt;dependency&amp;gt;
    &amp;lt;groupId&amp;gt;com.amazonaws&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;aws-java-sdk-s3&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;1.12.239&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;


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

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Add below parameters in application.properties under resources folder.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2F9xofcddbiiiulaoy91hp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F9xofcddbiiiulaoy91hp.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We will be dividing this into 3 parts.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Configuration class which will be responsible to 
  authenticate application with AWS S3 client.&lt;/li&gt;
&lt;li&gt;Service class responsible to interact with S3 bucket.&lt;/li&gt;
&lt;li&gt;Controller class containing APIs to perform file operations.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Configuration class:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

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

package com.springbootstorage.awss3.configuration;

import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class S3ClientConfiguration {

    @Value("${access.key.id}")
    @Getter
    private String accessKeyId;

    @Value("${access.key.secret}")
    @Getter
    private String accessKeSecret;

    @Value("${s3.region.name}")
    @Getter
    private String bucketRegion;

    @Bean
    public AmazonS3 getAwsS3Client() {
        BasicAWSCredentials basicAWSCredentials = new BasicAWSCredentials(accessKeyId, accessKeSecret);
        return AmazonS3ClientBuilder
                .standard()
                .withCredentials(new AWSStaticCredentialsProvider(basicAWSCredentials))
                .withRegion(bucketRegion)
                .build();
    }
}



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

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Service Class:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

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

package com.springbootstorage.awss3.service;

import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.model.*;
import lombok.Data;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

@Data
@Service
public class S3FileService {

    @Value("${s3.bucket.name}")
    private String s3BucketName;
    private final String DOWNLOAD_PATH = "D:\\S3Download\\";
    private final String UPLOAD_PATH = "E:\\";

    @Autowired
    private AmazonS3 amazonS3;

    // List all objects in the bucket
    public List&amp;lt;String&amp;gt; listAllObjects(String s3BucketName) {

        List&amp;lt;String&amp;gt; listOfObjects = new ArrayList&amp;lt;&amp;gt;();

        ObjectListing objectListing = amazonS3.listObjects(s3BucketName);
        for (S3ObjectSummary objectSummary : objectListing.getObjectSummaries()) {
            listOfObjects.add("FileName: " + objectSummary.getKey() +
                    " | " + "LastModified: " + objectSummary.getLastModified() +
                    " | " + "Size: " + objectSummary.getSize());
        }

        return listOfObjects;
    }

    // Downloading object from the bucket
    public String downloadObject(String s3BucketName, String objectName) {
        S3Object s3Object = amazonS3.getObject(s3BucketName, objectName);
        S3ObjectInputStream inputStream = s3Object.getObjectContent();
        try {
            FileUtils.copyInputStreamToFile(inputStream, new File( DOWNLOAD_PATH + objectName));
            return DOWNLOAD_PATH + objectName +  " Downloaded Successfully!";
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    // Upload object to the bucket
    public PutObjectResult uploadObject(String s3BucketName, String objectName, File objectToUpload) {
        return amazonS3.putObject(s3BucketName, objectName, objectToUpload);
    }

    public void deleteObject(String bucketName, String objectName) {
        amazonS3.deleteObject(bucketName, objectName);
    }
}


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

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Controller class:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

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

package com.springbootstorage.awss3.controller;

import com.amazonaws.services.s3.model.PutObjectResult;
import com.springbootstorage.awss3.service.S3FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.File;
import java.util.List;

@RestController
@RequestMapping("/api/v1")
public class S3Controller {

    @Autowired
    private S3FileService s3FileService;

    // List all files in the bucket
    @GetMapping("/listAllFiles")
    public String listAllFilesInBucket() {
        List&amp;lt;String&amp;gt; files = s3FileService.listAllObjects(s3FileService.getS3BucketName());
        StringBuilder allFiles = new StringBuilder();
        allFiles.append("****************************************\n");
        allFiles.append("List of Files available in bucket ").append(s3FileService.getS3BucketName());
        allFiles.append("\n****************************************\n");
        for (String filename : files)
            allFiles.append(files).append("\n");
        return allFiles.toString();
    }

    @PostMapping("/upload/{fileToUpload}")
    public PutObjectResult uploadFiletoBucket(@PathVariable String fileToUpload) {
        return s3FileService.uploadObject(s3FileService.getS3BucketName(), fileToUpload, new File(s3FileService.getUPLOAD_PATH()+ fileToUpload));
    }

    @PostMapping("/download/{fileToDownload}")
    public String downloadFileFromBucket(@PathVariable String fileToDownload) {
        return s3FileService.downloadObject(s3FileService.getS3BucketName(), fileToDownload);
    }

    @PostMapping("/delete/{fileToDelete}")
    public String deleteFileFromBucket(@PathVariable String fileToDelete) {
        s3FileService.deleteObject(s3FileService.getS3BucketName(), fileToDelete);
        return fileToDelete + " has been deleted successfully from " + s3FileService.getS3BucketName();
    }
}


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

&lt;/div&gt;

&lt;p&gt;Lets start Spring boot application and test this API for Listing, uploading, downloading and deleting objects on S3 bucket now.&lt;/p&gt;

&lt;p&gt;We have below 4 endpoints to perform these operations.&lt;/p&gt;

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

http://localhost:9090/api/v1/listAllFiles
http://localhost:9090/api/v1/upload/
http://localhost:9090/api/v1/download/
http://localhost:9090/api/v1/delete/


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

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Upload objects to S3 bucket.&lt;/li&gt;
&lt;/ul&gt;

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

curl -XPOST http://localhost:9090/api/v1/upload/sample1.jpg
curl -XPOST http://localhost:9090/api/v1/upload/sample2.jpg
curl -XPOST http://localhost:9090/api/v1/upload/employees.json


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

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.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%2F4wvmqtax7nq1tqca7tzz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F4wvmqtax7nq1tqca7tzz.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;List objects in bucket.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;curl http://localhost:9090/api/v1/listAllFiles&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fr2efzkcwmw42ue4ev91a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fr2efzkcwmw42ue4ev91a.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F77gqpp5o452m3y0fcf4d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F77gqpp5o452m3y0fcf4d.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Download objects from bucket.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;curl -XPOST http://localhost:9090/api/v1/download/employees.json&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fn2i1i4mtngo980v32wg1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fn2i1i4mtngo980v32wg1.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Delete objects from bucket.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;curl -XPOST http://localhost:9090/api/v1/delete/employees.json&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fma1yz5052vivl1k77hxo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fma1yz5052vivl1k77hxo.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fcpp6qsk1tqodvctzy3y5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fcpp6qsk1tqodvctzy3y5.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can manage creation/deletion of buckets programmatically as well. Please check out more such examples on this &lt;a href="https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/examples-s3.html" rel="noopener noreferrer"&gt;link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can find code for this project on below given GitHub repository.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/devanandukalkar/SpringBootAwsS3" rel="noopener noreferrer"&gt;https://github.com/devanandukalkar/SpringBootAwsS3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's it for this one. Hope you enjoyed reading it. Keep Learning!! Cheers!&lt;/p&gt;

</description>
      <category>springboot</category>
      <category>java</category>
      <category>aws</category>
      <category>programming</category>
    </item>
    <item>
      <title>FastJSON - Convert POJO to/from JSON</title>
      <dc:creator>Devanand Ukalkar</dc:creator>
      <pubDate>Thu, 14 Jul 2022 14:35:34 +0000</pubDate>
      <link>https://dev.to/devanandukalkar/fastjson-convert-pojo-tofrom-json-3iig</link>
      <guid>https://dev.to/devanandukalkar/fastjson-convert-pojo-tofrom-json-3iig</guid>
      <description>&lt;p&gt;Fastjson is a lightweight Java library created by Alibaba. It can be used to convert POJO (Plain Old Java Object) into their JSON representation &amp;amp; convert a JSON string to an equivalent POJO. Fastjson can work with arbitrary Java objects including pre-existing objects that you do not have source-code of.&lt;/p&gt;

&lt;p&gt;Let's dive straight into the example to look at how this library provides easy APIs to convert Java objects to / from JSON.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We will create one simple Maven project with following dependencies for FastJson and Lombok(for getters/setters) in pom.xml file.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&amp;gt;
    &amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;

    &amp;lt;groupId&amp;gt;com.example&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;fast-json-demo&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;1.0-SNAPSHOT&amp;lt;/version&amp;gt;

    &amp;lt;properties&amp;gt;
        &amp;lt;maven.compiler.source&amp;gt;11&amp;lt;/maven.compiler.source&amp;gt;
        &amp;lt;maven.compiler.target&amp;gt;11&amp;lt;/maven.compiler.target&amp;gt;
    &amp;lt;/properties&amp;gt;

    &amp;lt;dependencies&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;com.alibaba&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;fastjson&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;2.0.7&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.projectlombok&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;lombok&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;1.18.24&amp;lt;/version&amp;gt;
        &amp;lt;/dependency&amp;gt;
    &amp;lt;/dependencies&amp;gt;

&amp;lt;/project&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Lets write simple POJO Employee Class and a Main class to convert it into JSON.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;JSON.toJSONString()&lt;/strong&gt; method helps to serialize Employee object to JSON string.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Employee.java&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

@Data
public class Employee {

    @JSONField(name = "EmployeeId")
    private Integer id;

    @JSONField(name = "EmployeeName")
    private String name;

    @JSONField(name = "EmployeeLocation")
    private String location;

    @JSONField(name = "EmployeeSalary")
    private Double salary;

    public Employee(Integer id, String name, String location, Double salary) {
        this.id = id;
        this.name = name;
        this.location = location;
        this.salary = salary;
    }
}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Main.java&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import com.alibaba.fastjson2.JSON;

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static void main(String[] args) {

        List&amp;lt;Employee&amp;gt; employeeList = new ArrayList&amp;lt;&amp;gt;();

        employeeList.add(new Employee(1, "Stephen Hawking", "UK", 1000.00));
        employeeList.add(new Employee(2, "Albert Einstein", "Germany", 2000.00));

        // Convert Employee object to JSON
        String jsonString = JSON.toJSONString(employeeList);

        System.out.println(jsonString);
    }
}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fnez48rsour4zvnul2ip3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fnez48rsour4zvnul2ip3.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The JSON output is customizable with control over ordering of key-value pair. You will just need to pass an argument as &lt;code&gt;ordinal = &amp;lt;nth order&amp;gt;&lt;/code&gt; to &lt;code&gt;@JSONField&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; @JSONField(name = "EmployeeLocation", ordinal = 4)
    private String location;

 @JSONField(name = "EmployeeSalary", ordinal = 3)
    private Double Salary;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;if you compare the previous output with this one, the key's positions are ordered as specified.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F1esprx1hienl573ty47p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F1esprx1hienl573ty47p.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can choose to ignore some of the fields with &lt;code&gt;serialize=false&lt;/code&gt; parameter.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@JSONField(name = "EmployeeId", serialize = false)
    private Integer id;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;You can choose date formatting with &lt;code&gt;format="MM/dd/YYYY"&lt;/code&gt; parameter.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@JSONField(name = "EmployeeDoJ", format = "MM/dd/YYYY", ordinal = 5)
    private Date dateOfJoining;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.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%2F2zmffoqiksvi3lrbepcq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F2zmffoqiksvi3lrbepcq.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, lets parse JSON to Java object. We will look at converting a JSON String, array and file to an object.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Converting JSON String to Object can be done using &lt;code&gt;JSON.parseObject(jsonToConvert, Employee.class);&lt;/code&gt;. One of the things to note here is that, the Keys missing in JSON strings will be defaulted to &lt;strong&gt;"false"&lt;/strong&gt;. Additionally, if you choose not to deserialize any specific field, you can specify parameter as "deserialize=false" in the @JSONField annotation.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@JSONField(name = "EmployeeId", serialize = false, deserialize = false)
    private Integer id;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Convert JSON String to Java Object
String jsonToConvert = "{\"EmployeeName\":\"Stephen Hawking\",\"EmployeeSalary\":1000.0,\"EmployeeLocation\":\"UK\"}";
System.out.println("JSON to Convert ==&amp;gt; " + jsonToConvert + "\n");
Employee employeeObj = JSON.parseObject(jsonToConvert, Employee.class);
System.out.println("Converted to Employee Object ==&amp;gt; " + employeeObj);

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.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%2Fi4n4kgciwl6lqgw2avqm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fi4n4kgciwl6lqgw2avqm.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JSON array to Java object using &lt;code&gt;JSON.parseArray(jsonArrayToConvert, Employee.class);&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;String jsonArrayToConvert = "[{\"EmployeeName\":\"Stephen Hawking\",\"EmployeeSalary\":1000.0,\"EmployeeLocation\":\"UK\"},{\"EmployeeName\":\"Albert Einstein\",\"EmployeeSalary\":2000.0,\"EmployeeLocation\":\"Germany\"}]";
System.out.println("JSON Array to Convert ==&amp;gt; " + jsonArrayToConvert + "\n");
List&amp;lt;Employee&amp;gt; employees = JSON.parseArray(jsonArrayToConvert, Employee.class);
System.out.println("Converted to Employee Objects ==&amp;gt; " + employees);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.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%2Fxnohlqnw3tx2szjed9ir.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fxnohlqnw3tx2szjed9ir.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JSON file to Java Object --&amp;gt; FastJson bit lacks in direct JSON file support, it needs some extra code to to read from JSON file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;JSON File:&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.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%2Ffvcpbixpca79o9xoaewx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Ffvcpbixpca79o9xoaewx.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Convert JSON File to Java Object
try (Stream&amp;lt;String&amp;gt; lines = Files.lines(Paths.get("employees.json"))) {
    String jsonContent = lines.collect(Collectors.joining());
    List&amp;lt;Employee&amp;gt; empList = JSON.parseArray(jsonContent, Employee.class);
    System.out.println("Converted to Java Object ==&amp;gt; " + empList);
} catch (IndexOutOfBoundsException | IOException ex) {
    ex.printStackTrace();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.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%2F1vxh79vnwobyspkkxoru.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F1vxh79vnwobyspkkxoru.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can checkout more examples on below GitHub Repository.&lt;br&gt;
&lt;a href="https://github.com/eugenp/tutorials/tree/master/json-modules/json-2" rel="noopener noreferrer"&gt;https://github.com/eugenp/tutorials/tree/master/json-modules/json-2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Leave your reactions and comments below if you found this information useful! Cheers!!&lt;/p&gt;

</description>
      <category>java</category>
      <category>fastjson</category>
      <category>programming</category>
    </item>
    <item>
      <title>Monitoring Microservices with Spring Boot Admin</title>
      <dc:creator>Devanand Ukalkar</dc:creator>
      <pubDate>Sun, 10 Jul 2022 09:31:39 +0000</pubDate>
      <link>https://dev.to/devanandukalkar/monitoring-microservices-with-spring-boot-admin-4na7</link>
      <guid>https://dev.to/devanandukalkar/monitoring-microservices-with-spring-boot-admin-4na7</guid>
      <description>&lt;p&gt;The microservices enable the rapid, frequent and reliable delivery of large, complex applications. Monitoring, managing or troubleshooting poor performing microservice can be tedious task sometime, especially if you have to go to multiple places to look at what is happening under the hood. Be it looking for behavior of an application through log file, threads, heap memory etc. And you would certainly like all these things at one place for quick monitoring of your spring boot applications.&lt;/p&gt;

&lt;p&gt;Although &lt;strong&gt;&lt;a href="https://springframework.guru/actuator-in-spring-boot/#:~:text=Spring%20Boot%20Actuator%20is%20a,metrics%20from%20production%2Dready%20applications." rel="noopener noreferrer"&gt;Spring Boot Actuator&lt;/a&gt;&lt;/strong&gt; can do the magic for you if you have single app to look after. When you have multiple applications to monitor, &lt;strong&gt;Spring Boot Admin&lt;/strong&gt; is a great choice!&lt;/p&gt;

&lt;p&gt;Spring Boot Admin Server is an application used to manage and monitor your Microservice applications. CodeCentric team had developed Spring Boot Admin UI to manage your Spring Boot application actuator endpoints.&lt;/p&gt;

&lt;p&gt;Each microservice acts as a client and has to register to Spring boot admin server. Behind the curtain, admin server leverages application's actuator endpoints to gather all the data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F1r3l9cr1xoqhfc211hmj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F1r3l9cr1xoqhfc211hmj.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lets look at what is needed to build a Spring Boot Admin server.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to &lt;a href="https://start.spring.io/" rel="noopener noreferrer"&gt;https://start.spring.io/&lt;/a&gt; and Generate a starter project with mentioned dependencies.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Maven&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

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

        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;spring-boot-starter-web&amp;lt;/artifactId&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;de.codecentric&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;spring-boot-admin-starter-server&amp;lt;/artifactId&amp;gt;
        &amp;lt;/dependency&amp;gt;


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

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fe3nqvb54bx791nfehpbc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fe3nqvb54bx791nfehpbc.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add the &lt;strong&gt;@EnableAdminServer&lt;/strong&gt; annotation to your main application class. The &lt;strong&gt;@EnableAdminServer&lt;/strong&gt; annotation will turn your spring boot application to Admin Server and monitor all other microservices.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fx7p54qy9ac8kurejxb9m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fx7p54qy9ac8kurejxb9m.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Define application name and port in application.properties&lt;/li&gt;
&lt;/ul&gt;

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

spring.application.name=adminserver
server.port=9090


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

&lt;/div&gt;

&lt;p&gt;And that's all about it! Your Spring Boot Admin server is ready to run and serve the clients connecting to it. &lt;/p&gt;

&lt;p&gt;Tomcat server will be started on the port 9090 as specified. You can launch Spring Boot Admin UI by browsing &lt;strong&gt;&lt;a href="http://localhost:9090" rel="noopener noreferrer"&gt;http://localhost:9090&lt;/a&gt;&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fy7ezzavt13xfhll8mjmo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fy7ezzavt13xfhll8mjmo.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fa5qz8mkic0ahjumyh7jt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fa5qz8mkic0ahjumyh7jt.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Now that our Admin server is all setup, lets write couple of client applications to place on monitoring.&lt;/p&gt;

&lt;p&gt;You will need to add below dependencies to pom.xml file.&lt;/p&gt;

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

        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;spring-boot-starter-actuator&amp;lt;/artifactId&amp;gt;
        &amp;lt;/dependency&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;de.codecentric&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;spring-boot-admin-starter-client&amp;lt;/artifactId&amp;gt;
        &amp;lt;/dependency&amp;gt;


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

&lt;/div&gt;

&lt;p&gt;I have created two REST API applications for demo. We need to setup these as a client to connect to admin server. &lt;/p&gt;

&lt;p&gt;We need to add few properties to application.properties file as given below.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note:&lt;/strong&gt; From Spring Boot 2 and above, actuator endpoints except health and info are restricted. That why we are exposing all the endpoints by specifying the properties explicitly.&lt;/em&gt;&lt;/p&gt;

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

# Application
spring.application.name=Demo API
server.port=8080

# Spring boot admin server 
spring.boot.admin.client.url=http://localhost:9090

# Actuator endpoints properties
management.endpoints.web.exposure.include=*
management.endpoint.health.show-details=always

# To monitor log file on admin server
logging.file.name=demo_api.log
logging.logback.rollingpolicy.max-history=5
logging.logback.rollingpolicy.max-file-size=10MB


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

&lt;/div&gt;

&lt;p&gt;Once client applications are started, they will be registered to admin server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fenv1m7rk8ev5uabltdd5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fenv1m7rk8ev5uabltdd5.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can now see the applications being monitored on Spring Boot Admin UI Wallboard with their overall status.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F3hsr84m1c2ey57ilm5e4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F3hsr84m1c2ey57ilm5e4.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Applications tab will show you the details on number of applications up/down, overall status, lets you filter the apps etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fqxfr15cipwkvx6roun28.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fqxfr15cipwkvx6roun28.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Journal tab will give you the audit details on startup/shutdown of a particular application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F3fwv2evvcbtcizl5pfrv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F3fwv2evvcbtcizl5pfrv.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lets look at what other granular details are being provided for each of these applications.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can look at overall health of an application instance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fcthx7tiu2qm3lw7xe476.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fcthx7tiu2qm3lw7xe476.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add metrics as per your requirement.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2F19cdru16e9sgd1uhgb04.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F19cdru16e9sgd1uhgb04.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Details on system environment&lt;br&gt;
&lt;a href="https://media.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%2F602y2js8nxbkbs0u4c7f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F602y2js8nxbkbs0u4c7f.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Application beans&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fnjvpq1iukoaadi0h2u3o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fnjvpq1iukoaadi0h2u3o.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configuration details and scheduled tasks if any&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fb9amof7gkafyc93n9ip7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fb9amof7gkafyc93n9ip7.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can monitor and download logs of an application&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2F77vnkpbsu6qorhoykoxw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F77vnkpbsu6qorhoykoxw.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can set the logger level as well&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fx77dfdfjm4ovg7lxbc6v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fx77dfdfjm4ovg7lxbc6v.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JVM related details on Thread and Heap dump.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2F11ulyiq6r78ot30c57k3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F11ulyiq6r78ot30c57k3.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;URI mappings of an application&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fo9udinrb0mn8eyfc1osc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fo9udinrb0mn8eyfc1osc.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cache details of an application&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fxgebwd5gf9yvtpaowg9z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fxgebwd5gf9yvtpaowg9z.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, we have all the details about an application at one place now. &lt;/p&gt;

&lt;p&gt;Lets look at few other modules provided by Spring Boot Admin.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We had exposed all the actuator endpoints to admin server which in turn will expose all the sensitive information about an application as well. It becomes pivotal to secure admin UI and have only authorized personnel look at it. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can refer &lt;a href="https://codecentric.github.io/spring-boot-admin/current/#securing-spring-boot-admin" rel="noopener noreferrer"&gt;https://codecentric.github.io/spring-boot-admin/current/#securing-spring-boot-admin&lt;/a&gt; to secure admin UI.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Notification about a particular event in an application is also of great importance to avoid eye on the glass monitoring.
Spring boot admin notifications module provides lot of options to notify user via Email, MS teams, Slack etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Checkout &lt;a href="https://codecentric.github.io/spring-boot-admin/current/#_notifications" rel="noopener noreferrer"&gt;https://codecentric.github.io/spring-boot-admin/current/#_notifications&lt;/a&gt; for more details.&lt;/p&gt;

&lt;p&gt;I hope you enjoyed reading about Spring Boot Admin in this article. Leave your reactions and comments below if you found this useful. Keep Learning!&lt;/p&gt;

</description>
      <category>java</category>
      <category>springboot</category>
      <category>microservices</category>
      <category>monitoring</category>
    </item>
    <item>
      <title>Want to run Python in web browser? PyScript is here!</title>
      <dc:creator>Devanand Ukalkar</dc:creator>
      <pubDate>Wed, 06 Jul 2022 12:14:52 +0000</pubDate>
      <link>https://dev.to/devanandukalkar/want-to-run-python-in-web-browser-pyscript-is-here-1cii</link>
      <guid>https://dev.to/devanandukalkar/want-to-run-python-in-web-browser-pyscript-is-here-1cii</guid>
      <description>&lt;p&gt;&lt;strong&gt;PyScript&lt;/strong&gt; is a brand new framework that allows users to create Python applications in the browser within HTML code itself. It is powered with Pyodide and WASM.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Pyodide is a Python distribution for the browser and Node.js based on WebAssembly. (&lt;a href="https://pyodide.org/en/stable/"&gt;Source&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;On technical level, PyScript is built with TypeScript, Svelte Framework, Python, JavaScript, Tailwind CSS and bundled with rollup.js&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UIXwZOO1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uziplf7xns5lbmj7o974.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UIXwZOO1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uziplf7xns5lbmj7o974.png" alt="Image description" width="323" height="137"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some of the core components of PyScript involve (&lt;a href="https://pyscript.net/"&gt;Source&lt;/a&gt;):&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Python in the browser:&lt;/strong&gt; Enable drop-in content, external file hosting, and application hosting without the reliance on server-side configuration&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Python ecosystem:&lt;/strong&gt; Run many popular packages of Python and the scientific stack (such as numpy, pandas, scikit-learn, and more)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Python with JavaScript:&lt;/strong&gt; Bi-directional communication between Python and Javascript objects and namespaces&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Environment management:&lt;/strong&gt; Allow users to define what packages and files to include for the page code to run&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Visual application development:&lt;/strong&gt; Use readily available curated UI components, such as buttons, containers, text boxes, and more&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flexible framework:&lt;/strong&gt; A flexible framework that can be leveraged to create and share new pluggable and extensible components directly in Python&lt;/p&gt;

&lt;p&gt;You might be thinking that, is it going to replace the behemoth JavaScript which powers 95% of the websites?...Not really! Currently, PyScript is an experimental project in its alpha phase with lots of issues from its usability to slowness. So it's clearly not recommended to use in Production at the moment.&lt;/p&gt;

&lt;p&gt;Lets look at what is needed to use PyScript in HTML code.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You will need to add below links in &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; tag.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" /&amp;gt;
&amp;lt;script defer src="https://pyscript.net/alpha/pyscript.js"&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;You can then use PyScript components in your html page. Some of the elements PyScript currently implements are:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;py-script&amp;gt;&lt;/code&gt;: can be used to define python code that is executable within the web page. The element itself is not rendered to the page and is only used to add logic.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;py-env&amp;gt;&lt;/code&gt; : manages project dependencies similar to pip tool.&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;py-env&amp;gt;
    - matplotlib
    - numpy
&amp;lt;/py-env&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;&amp;lt;py-repl&amp;gt;&lt;/code&gt;: creates a REPL component that is rendered to the page as a code editor and allows users to write executable code.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can also use your custom python modules. Below is the example.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;py-env&amp;gt;
    - matplotlib
    - numpy
    - paths:
        - src/data.py
&amp;lt;/py-env&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are many more tags that you can find on their &lt;a href="https://github.com/pyscript/pyscript"&gt;github &lt;/a&gt; repository.&lt;/p&gt;

&lt;p&gt;Let's write some code to demonstrate few examples of above tags.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Say Hello to PyScript&lt;/strong&gt;&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;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;title&amp;gt;Hello, PyScript!&amp;lt;/title&amp;gt;
  &amp;lt;link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" /&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
  &amp;lt;py-script&amp;gt;print("Hello, PyScript!")&amp;lt;/py-script&amp;gt;
  &amp;lt;script defer src="https://pyscript.net/alpha/pyscript.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1_KChi3f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rcsehhiwamwor15b0cjz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1_KChi3f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rcsehhiwamwor15b0cjz.png" alt="Image description" width="556" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Build your own REPL&lt;/strong&gt;&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;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;

&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;PyScript REPL&amp;lt;/title&amp;gt;
    &amp;lt;link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" /&amp;gt;
    &amp;lt;script defer src="https://pyscript.net/alpha/pyscript.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
    &amp;lt;div class="text-center"&amp;gt;
        &amp;lt;br&amp;gt;
        &amp;lt;h1&amp;gt;&amp;lt;b&amp;gt;PyScript REPL&amp;lt;/b&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;br&amp;gt;
        &amp;lt;pre&amp;gt;Tip: Press Shift+ENTER to evaluate cell&amp;lt;/pre&amp;gt;
        &amp;lt;br&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div&amp;gt;
        &amp;lt;py-repl id="my-repl" auto-generate="true"&amp;gt;&amp;lt;/py-repl&amp;gt;
    &amp;lt;/div&amp;gt;

&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Y0YWm4bk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qu9x2leypqrsanjwhsyk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y0YWm4bk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qu9x2leypqrsanjwhsyk.png" alt="Image description" width="880" height="311"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Plot graph using matplotlib and numpy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;plot.html&lt;/em&gt;&lt;/strong&gt;&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;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;

&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;PyScript Plot&amp;lt;/title&amp;gt;
    &amp;lt;link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" /&amp;gt;
    &amp;lt;script defer src="https://pyscript.net/alpha/pyscript.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;py-env&amp;gt;
        - matplotlib
        - numpy
        - paths:
            - /pyscript_plot.py
    &amp;lt;/py-env&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
    &amp;lt;br&amp;gt;
    &amp;lt;h1&amp;gt;&amp;lt;b&amp;gt;PyScript Plot&amp;lt;/h1&amp;gt;&amp;lt;br&amp;gt;
    &amp;lt;div id="plot"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;py-script output="plot"&amp;gt;
from matplotlib import pyplot as plt
from pyscript_plot import get_values

x, y = get_values()
fig, ax = plt.subplots()
ax.scatter(x, y)
fig
    &amp;lt;/py-script&amp;gt;

&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;pyscript_plot.py&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import numpy as np
import math 

def get_values():
    x = np.arange(0, math.pi*2, 0.05)
    y = np.sin(x)
    return x, y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dICUdDGs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5la4hvd5edo3ao3fjgze.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dICUdDGs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5la4hvd5edo3ao3fjgze.png" alt="Image description" width="616" height="599"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can find more examples on below link.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/pyscript/pyscript/tree/main/examples"&gt;https://github.com/pyscript/pyscript/tree/main/examples&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The entire project indeed looks promising. Given that its in alpha phase right now, We will have to wait and see how this framework takes shape and accepted within developers community.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep Learning...Cheers!&lt;/strong&gt; 😃&lt;/p&gt;

</description>
      <category>python</category>
      <category>pyscript</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Deploy Spring Boot application to AWS Elastic Beanstalk and RDS</title>
      <dc:creator>Devanand Ukalkar</dc:creator>
      <pubDate>Fri, 01 Jul 2022 19:48:28 +0000</pubDate>
      <link>https://dev.to/devanandukalkar/deploy-spring-boot-application-to-aws-elastic-beanstalk-and-rds-19ff</link>
      <guid>https://dev.to/devanandukalkar/deploy-spring-boot-application-to-aws-elastic-beanstalk-and-rds-19ff</guid>
      <description>&lt;p&gt;Are you looking to deploy your application to AWS without hassle of managing infrastructure?&lt;/p&gt;

&lt;p&gt;With AWS Elastic Beanstalk, you can quickly deploy and manage applications in the AWS Cloud without worrying about the infrastructure that runs those applications.&lt;/p&gt;

&lt;p&gt;In this article, we will be looking at steps to deploy spring boot application with MySQL Database to AWS Elastic Beanstalk and RDS. &lt;br&gt;
Lets get started!&lt;/p&gt;




&lt;ul&gt;
&lt;li&gt;First of all, We need to setup MySQL database using AWS RDS. I wrote an article on how to use RDS to provision a MySQL database. Please follow below link for the same.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://dev.to/devanandukalkar/how-to-create-database-using-aws-rds-meh"&gt;https://dev.to/devanandukalkar/how-to-create-database-using-aws-rds-meh&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once your database is ready, add mysql-connector dependency 
to pom.xml file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rKYbe6Oc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kafbxib6s7avhp4yt177.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rKYbe6Oc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kafbxib6s7avhp4yt177.jpg" alt="Image description" width="421" height="107"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Update the properties file with details from provisioned database.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LdQfHMR2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/70l5mywckzdfmg4x4cae.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LdQfHMR2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/70l5mywckzdfmg4x4cae.jpg" alt="Image description" width="880" height="122"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go to AWS console and search for "&lt;em&gt;Elastic Beanstalk&lt;/em&gt;".&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KCuug-kb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/murwbaabd38mbu9x1qre.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KCuug-kb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/murwbaabd38mbu9x1qre.jpg" alt="Image description" width="880" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on "&lt;em&gt;Create Application&lt;/em&gt;" to start the deployment wizard.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FwTUSmxu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kymnwzuxvvbga1abm1mw.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FwTUSmxu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kymnwzuxvvbga1abm1mw.jpg" alt="Image description" width="810" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Type in your application name &amp;amp; platform needed to run it (&lt;em&gt;There are many other options to choose from&lt;/em&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Isupupp7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jvhs2henylm0swz6lyka.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Isupupp7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jvhs2henylm0swz6lyka.jpg" alt="Image description" width="792" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hpYzgAqv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s0ylta85m9fmbtm11zgg.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hpYzgAqv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s0ylta85m9fmbtm11zgg.jpg" alt="Image description" width="824" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Under "&lt;em&gt;Source code origin&lt;/em&gt;" choose local file and upload the jar for your application &amp;amp; click &lt;em&gt;Create Application&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Fxw_c456--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ivn8eh4740zcnuu4lb8g.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Fxw_c456--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ivn8eh4740zcnuu4lb8g.jpg" alt="Image description" width="818" height="472"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your environment could take few minutes to deploy.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cszqVGyF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gjwefhd58criiqbknqxo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cszqVGyF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gjwefhd58criiqbknqxo.jpg" alt="Image description" width="880" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--00z8b0sZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6mmf4fdasqn6ymlyn3qw.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--00z8b0sZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6mmf4fdasqn6ymlyn3qw.jpg" alt="Image description" width="880" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Once the environment is created, use given link to access your application. The &lt;strong&gt;"Health"&lt;/strong&gt; on the snapshot says severe because AWS process checks if there is a response from root of your application. Make sure your WebApp or API does not throws 5xx error on the root path.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can always reupload your code with section given as "&lt;em&gt;Upload and deploy&lt;/em&gt;". That's about it! &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please leave your reactions and comment below if you found this short article helpful!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>java</category>
      <category>mysql</category>
      <category>springboot</category>
    </item>
    <item>
      <title>Guide to Dockerize your Spring Boot application with MySQL database</title>
      <dc:creator>Devanand Ukalkar</dc:creator>
      <pubDate>Thu, 30 Jun 2022 21:27:47 +0000</pubDate>
      <link>https://dev.to/devanandukalkar/guide-to-dockerize-your-spring-boot-application-with-mysql-b9g</link>
      <guid>https://dev.to/devanandukalkar/guide-to-dockerize-your-spring-boot-application-with-mysql-b9g</guid>
      <description>&lt;p&gt;So, you want to build a Java Spring Boot application and run it inside a Docker container? This article will provide you step by step guide to build MySQL Database &amp;amp; spring boot application images to run it in a container.&lt;/p&gt;

&lt;p&gt;I will be using AWS EC2 Linux instance in this article, but all the commands will be similar on other OS except the installation part.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First step is to have docker installed on the machine that you are using. Follow steps on below link for installation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://docs.docker.com/engine/install/ubuntu/" rel="noopener noreferrer"&gt;https://docs.docker.com/engine/install/ubuntu/&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once Docker is installation is finished, check if its installed correctly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;docker -v&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media.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%2F2iywz79aetrbuuvgy6f8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F2iywz79aetrbuuvgy6f8.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker info&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media.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%2F9ca6sq3g22smgsd0ehoj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F9ca6sq3g22smgsd0ehoj.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I am using MySQL database in this application, so we will have to first create docker network for the MySQL database.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pull the MySQL image from docker hub and check if its available locally.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;docker pull mysql:5.7&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media.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%2Flx34z9uidu0udl418w36.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Flx34z9uidu0udl418w36.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker images&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media.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%2F1zk4h8zv4updpeq23drv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F1zk4h8zv4updpeq23drv.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create docker network for Spring boot application to communicate with MySQL database.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;docker network create springboot-mysql-net&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media.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%2Ftdmhtgpbqbjv7dag56e8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Ftdmhtgpbqbjv7dag56e8.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run the MySQL container in the network and wait for few minutes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;docker run -it --name mysqldb --network=springboot-mysql-net -e MYSQL_ROOT_PASSWORD=1234 -e MYSQL_DATABASE=expensetracker -e MYSQL_USER=sys -e MYSQL_PASSWORD=1234 -d mysql:5.7&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fkd8zx1gpujkwo3k7jw5t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fkd8zx1gpujkwo3k7jw5t.png" alt="Image description"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now that MySQL container is running, Lets check if the database is created using interactive mode. To connect to mysqldb container in interactive mode, you can use below command with few initial characters from the container id.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Syntax:&lt;/em&gt; &lt;code&gt;docker exec -it &amp;lt;container-id&amp;gt; bash&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker exec -it 81e7 bash&lt;/code&gt;&lt;br&gt;
&lt;code&gt;mysql -u sys -p 1234&lt;/code&gt;&lt;br&gt;
&lt;code&gt;show databases;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F6i9h649eca01kw8cgyeu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F6i9h649eca01kw8cgyeu.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;With MySql database running in container now, lets move on to update the application properties to connect to this database.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# MySQL properties
spring.datasource.url=jdbc:mysql://mysqldb:3306/expensetracker
spring.datasource.username=sys
spring.datasource.password=1234
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.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%2Fc8yugtwx6vtbhqicftdl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fc8yugtwx6vtbhqicftdl.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now we need to build docker image from the spring boot application jar using Dockerfile. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2Ff0e7ww0neeqvwzmiqmic.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Ff0e7ww0neeqvwzmiqmic.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run below command to build the docker image.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;docker build -t springbootmysql .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fve5y2siqhkc13q8rdy5m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fve5y2siqhkc13q8rdy5m.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;So, We have our mysql database container running and we have built docker image for the application, lets start the spring boot container on the same network as that of the database one.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;docker run --network=springboot-mysql-net --name springboot-container -p 8080:8080 -d springbootmysql&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Filjmeapaup318ge26kck.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Filjmeapaup318ge26kck.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.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%2Fnln0sp489wf5ok48sb0r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fnln0sp489wf5ok48sb0r.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;As you can see, our spring boot application is now running in a container.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lets see how we can push this image to docker hub. You will first need to create your account &lt;a href="https://hub.docker.com/" rel="noopener noreferrer"&gt;https://hub.docker.com/&lt;/a&gt;&lt;br&gt;
Once account is created, login to docker hub using &lt;code&gt;docker login&lt;/code&gt; command.&lt;br&gt;
&lt;a href="https://media.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%2F17sg2rxe8wa9uza23ra2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F17sg2rxe8wa9uza23ra2.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once login is successful, you can use below command(change name as per your login &amp;amp; image) to push the image to docker hub.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;docker push devanandukalkar/springbootmysql&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F6r3hz7xfhiwlra55sxss.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F6r3hz7xfhiwlra55sxss.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fjv1tn00xt91qmdyocu6f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fjv1tn00xt91qmdyocu6f.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hopefully, you find this article useful. Let me know your feedback in comments section.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>springboot</category>
      <category>mysql</category>
      <category>java</category>
    </item>
    <item>
      <title>How to provision database using AWS RDS for your next application</title>
      <dc:creator>Devanand Ukalkar</dc:creator>
      <pubDate>Tue, 28 Jun 2022 12:22:06 +0000</pubDate>
      <link>https://dev.to/devanandukalkar/how-to-create-database-using-aws-rds-meh</link>
      <guid>https://dev.to/devanandukalkar/how-to-create-database-using-aws-rds-meh</guid>
      <description>&lt;p&gt;Amazon Relational Database Service (RDS) is a distributed relational database service by Amazon Web Services. It is a web service running "in the cloud" designed to simplify the setup, operation, and scaling of a relational database for use in applications.&lt;/p&gt;

&lt;p&gt;This article will guide you through the simple steps to provision a production grade database for your application within matter of minutes. Lets get started!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First obvious step is to create AWS account to avail the services.&lt;/li&gt;
&lt;li&gt;Once you have your account ready, Search for RDS on AWS homepage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3ys4ITGt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wjlwux0za0vc9vxl6m4w.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3ys4ITGt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wjlwux0za0vc9vxl6m4w.jpg" alt="Image description" width="880" height="517"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scroll bit down and click on "Create Database" button.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cCVhP7Mm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a61nyzazeaed8e9z5g0e.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cCVhP7Mm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a61nyzazeaed8e9z5g0e.jpg" alt="Image description" width="880" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose "Standard Create" as database creation method &amp;amp; Select MySQL from the Engine options (You can choose database as per your need).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3NvdqIRa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v0fe55915ejl7csk7kck.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3NvdqIRa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v0fe55915ejl7csk7kck.jpg" alt="Image description" width="880" height="535"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select MySQL version and template as "Free Tier" &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--REjL-CF5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sp0uvmb0u9deql4urdkf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--REjL-CF5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sp0uvmb0u9deql4urdkf.jpg" alt="Image description" width="880" height="487"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Move to Settings section and enter details such as your database name in "DB Instance Identifier", username and password.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3BkhxrnX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hmy52vdzujwzhnux8bxa.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3BkhxrnX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hmy52vdzujwzhnux8bxa.jpg" alt="Image description" width="880" height="528"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Leave all other default options and hit on "Create database" at the bottom&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qCdt7I65--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/66dbwfx257mfn8iq7skv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qCdt7I65--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/66dbwfx257mfn8iq7skv.jpg" alt="Image description" width="880" height="541"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Database creation would take up to 10 mins. The status would be changed to available once its provisioned.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8XqrHk4n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ppsxb8soeaqfobueitvg.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8XqrHk4n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ppsxb8soeaqfobueitvg.jpg" alt="Image description" width="880" height="174"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once database is created, you will see database related details such as Endpoint &amp;amp; port, network, security etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iIsvDPBF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kbmrs66sciys31mhhdtf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iIsvDPBF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kbmrs66sciys31mhhdtf.jpg" alt="Image description" width="880" height="392"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your database is not yet available to connect publicly. the Security group needs to have a rule to allow database to be accessed over the internet. Using "Security group rules", add following mentioned inbound rules to your database endpoint.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--c36KO1zF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ps7fx7jmwq70j7o4cbt2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--c36KO1zF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ps7fx7jmwq70j7o4cbt2.jpg" alt="Image description" width="880" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EJ4uI0XO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l0bwj8ab1w0lx82x0oew.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EJ4uI0XO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l0bwj8ab1w0lx82x0oew.jpg" alt="Image description" width="880" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XpBUPaOg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h7vgbqnq8equxwxzhfao.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XpBUPaOg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h7vgbqnq8equxwxzhfao.jpg" alt="Image description" width="880" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You are now ready to test your database connections!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this case, Open MySQL Workbench and test the connection using the database Endpoint, port, username and password given at the time of provisioning. &lt;em&gt;&lt;strong&gt;Yoohooo! It's all ready to be used by your application now!&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CwfmpYT9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wlbcylq2o02ir42pht2o.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CwfmpYT9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wlbcylq2o02ir42pht2o.jpg" alt="Image description" width="880" height="507"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>rds</category>
      <category>mysql</category>
      <category>cloud</category>
    </item>
    <item>
      <title>How I cleared Microsoft Azure AZ-204 in one month</title>
      <dc:creator>Devanand Ukalkar</dc:creator>
      <pubDate>Fri, 28 Jan 2022 09:35:09 +0000</pubDate>
      <link>https://dev.to/devanandukalkar/how-i-cleared-az-204-in-one-month-51k8</link>
      <guid>https://dev.to/devanandukalkar/how-i-cleared-az-204-in-one-month-51k8</guid>
      <description>&lt;p&gt;&lt;strong&gt;AZ-204: Developing Solutions for Microsoft Azure&lt;/strong&gt; focuses on design, development, deployment, maintenance and monitoring of scalable solutions on Azure. There is no pre-requisite for this certification. But if you complete &lt;a href="https://docs.microsoft.com/en-us/learn/certifications/exams/az-900"&gt;AZ-900: Azure Fundamentals&lt;/a&gt; before, your learning process will speed up in terms of understanding some of the general concepts of Microsoft Azure. The exam covers each of these aspects with varying weightage. Below are the core skills that Microsoft has outlined on their learning portal.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Develop Azure compute solutions (25-30%)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Develop for Azure storage (15-20%)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Implement Azure security (20-25%)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Monitor, troubleshoot, and optimize Azure solutions (15-20%)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Connect to and consume Azure services and third-party services (15-20%)&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Detailed exam skills outline can be found &lt;a href="https://query.prod.cms.rt.microsoft.com/cms/api/am/binary/RE4oZ7B"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Just to give you a glimpse of what Azure services will need to be studied from exam perspective.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Azure Virtual Machines&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Azure Functions&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Azure Storage Account&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Azure Web Apps&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Azure Logic Apps&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Azure Cosmo DB&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Azure Container Registry/Docker&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Azure Key Vault&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Azure Active Directory&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Azure Authentication(OAuth 2.0), Security&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Azure Service Bus/Queue, Azure Storage queues&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Azure Event Grid, Event Hub&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Azure API management&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Azure Cache for Redis&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Azure ARM Templates&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Application Insights&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Azure Monitor&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Azure CLI, Powershell&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Azure Batch&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Azure Search&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The exam will require a bit of experience with programming languages supported by Azure (e.g. C#, Python, Java, Node.js). Although the tutorials present out there are mostly using C# for development. But it should not matter much as there are Azure SDKs for each of these supported languages which you can use to develop a solution. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How I prepared for the exam:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I started with Scott Duffy's &lt;a href="https://www.udemy.com/course/70532-azure/"&gt;AZ-204 Developing for Microsoft Azure Exam Prep&lt;/a&gt; course on Udemy. This course covers practical guide to develop each Azure services outlined for the exam. It can be completed within a week or two(depending on your speed).&lt;/p&gt;

&lt;p&gt;The second course that I referred to was from Alan Rodrigues on YouTube (&lt;a href="https://www.youtube.com/watch?v=wWBW6ojr-Nw&amp;amp;list=PLLc2nQDXYMHpekgrToMrDpVtFtvmRSqVt"&gt;link&lt;/a&gt;). This course is bit more on hours but provides comprehensive knowledge. Alan has developed solutions for each of those Azure services from scratch using C#/.Net in the tutorials.&lt;/p&gt;

&lt;p&gt;If you are short on time, I would suggest to take first course by Scott Duffy. But If you really want to learn it in detail, I would really recommend to take Alan Rodrigues's course on YouTube. &lt;/p&gt;

&lt;p&gt;As the course covers a lot, it's almost impossible to grasp it by just watching the videos. You must practice developing these solutions using your preferred choice of programming language. That way, it will be easier to understand nitty-gritty concepts which would ultimately help you in exam.&lt;/p&gt;

&lt;p&gt;I had practiced azure development using Python. The SDKs can be found on this &lt;a href="https://github.com/Azure/azure-sdk-for-python"&gt;GitHub&lt;/a&gt; link. There are many built in extensions for these Azure services in Visual Studio Code, please make sure to utilize them.&lt;/p&gt;

&lt;p&gt;Additionally, you could read Microsoft's official documentation and make use of their learning portal. Details can be found &lt;a href="https://docs.microsoft.com/en-us/learn/certifications/azure-developer/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Practice Questions:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Practicing questions should make about 30% of your preparation time. This is very important, as you would get to know the variety of questions that will be asked and how to manage time during examination. &lt;/p&gt;

&lt;p&gt;There are about 2 case studies given in the exam with 10-15 questions based on the same. It could take time to read the case study and understand the problem. Trick is to not read entire problem. Instead, read question first and then head back to related specific portion of the case study. This will help in save time during exam. &lt;/p&gt;

&lt;p&gt;You must get good grasp on Azure CLI, powershell commands &amp;amp; related arguments, as there are many questions related to completing the command by filling in the blanks. There are few questions on completing the unfinished code as well (e.g importing libraries or invoking methods/classes)&lt;/p&gt;

&lt;p&gt;I would recommend below 2 resources to practice questions for AZ-204.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Practice tests by &lt;a href="https://skillcertpro.com/product/developing-solutions-for-microsoft-azure-az-204-practice-exam-test/"&gt;Skillcertpro&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Practice tests by &lt;a href="https://www.whizlabs.com/microsoft-azure-certification-az-204/"&gt;Whizlabs&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In fact, even if you complete just the first one, it should be more than enough to clear the examination.&lt;/p&gt;

&lt;p&gt;Key is to have as much hands on experience as possible. I hope this will help you to prepare for examination. &lt;/p&gt;

&lt;p&gt;Best of luck and Let me know your questions in comment section.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check out my verified badge:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://www.credly.com/badges/05857a22-73a8-4ec2-a438-c5ee8733d6ee"&gt;https://www.credly.com/badges/05857a22-73a8-4ec2-a438-c5ee8733d6ee&lt;/a&gt;&lt;/p&gt;

</description>
      <category>azure</category>
      <category>az204</category>
      <category>python</category>
    </item>
  </channel>
</rss>
