Skip to content

copilot-dev-days/appmod-workshop-java

Repository files navigation

Asset Manager

This document serves as a comprehensive workshop guide that will walk you through the process of modernizing a Java application using GitHub Copilot app modernization. The workshop covers assessment, Java/framework upgrades, health endpoints, and containerization.

What the modernization Process Will Do: The modernization will transform your application from the outdated technologies to a modern solution. This includes upgrading from Java 8 to Java 21, migrating from Spring Boot 2.x to 3.x, adding health checks, and containerizing the applications.

Table of Contents

Overview

The main branch of the asset-manager project is the original state before being modernized. It is organized as follows:

  • AWS S3 for image storage, using password-based authentication (access key/secret key)
  • RabbitMQ for message queuing, using password-based authentication
  • PostgreSQL database for metadata storage, using password-based authentication

In this workshop, you will use the GitHub Copilot app modernization extension to assess, upgrade, and containerize the project.

Time Estimates: The complete workshop takes approximately 35 minutes to complete. Here's the breakdown for each major step:

  • Assess Your Java Application: ~5 minutes
  • Upgrade Runtime & Frameworks: ~10 minutes
  • Expose Health Endpoints: ~15 minutes
  • Containerize Applications: ~5 minutes

Current Architecture

flowchart TD

%% Applications
WebApp[Web Application]
Worker[Worker Service]

%% Storage Components
S3[(AWS S3)]
LocalFS[("Local File System<br/>dev only")]

%% Message Broker
RabbitMQ(RabbitMQ)

%% Database
PostgreSQL[(PostgreSQL)]

%% Queues
Queue[image-processing queue]
RetryQueue[image-processing.retry queue]

%% User
User([User])

%% User Flow
User -->|Upload Image| WebApp
User -->|View Images| WebApp

%% Web App Flows
WebApp -->|Store Original Image| S3
WebApp -->|Store Original Image| LocalFS
WebApp -->|Send Processing Message| RabbitMQ
WebApp -->|Store Metadata| PostgreSQL
WebApp -->|Retrieve Images| S3
WebApp -->|Retrieve Images| LocalFS
WebApp -->|Retrieve Metadata| PostgreSQL

%% RabbitMQ Flow
RabbitMQ -->|Push Message| Queue
Queue -->|Processing Failed| RetryQueue
RetryQueue -->|After 1 min delay| Queue
Queue -->|Consume Message| Worker

%% Worker Flow
Worker -->|Download Original| S3
Worker -->|Download Original| LocalFS
Worker -->|Upload Thumbnail| S3
Worker -->|Upload Thumbnail| LocalFS
Worker -->|Store Metadata| PostgreSQL
Worker -->|Retrieve Metadata| PostgreSQL

%% Styling
classDef app fill:#90caf9,stroke:#0d47a1,color:#0d47a1
classDef storage fill:#a5d6a7,stroke:#1b5e20,color:#1b5e20
classDef broker fill:#ffcc80,stroke:#e65100,color:#e65100
classDef db fill:#ce93d8,stroke:#4a148c,color:#4a148c
classDef queue fill:#fff59d,stroke:#f57f17,color:#f57f17
classDef user fill:#ef9a9a,stroke:#b71c1c,color:#b71c1c

class WebApp,Worker app
class S3,LocalFS storage
class RabbitMQ broker
class PostgreSQL db
class Queue,RetryQueue queue
class User user
Loading

Password-based authentication

Run Locally

Clone the repository and open the asset-manager folder to run the current project locally:

git clone https://github.com/copilot-dev-days/appmod-workshop-java.git
cd appmod-workshop-java

Prerequisites:

  • JDK 8: Required for running the initial application locally.
  • Maven 3.6.0+: Required to build the application locally.
  • Docker: Required for running the application locally.

Run the following commands to start the apps locally. This will:

  • Use the local file system instead of S3 to store images
  • Launch RabbitMQ and PostgreSQL using Docker

Windows:

scripts\startapp.cmd

Linux:

scripts/startapp.sh

To stop, run stopapp.cmd or stopapp.sh in the scripts directory.

App Modernization Workshop

Ready to modernize this application? Follow the step-by-step workshop guide:

👉 Start the Workshop →

The workshop covers:

  • Installing GitHub Copilot app modernization
  • Assessing your Java application
  • Upgrading runtime & frameworks (Java 8 → 21, Spring Boot 2.x → 3.x)
  • Exposing health endpoints using custom skills
  • Containerizing applications

About

Asset Manager - extracted from Azure-Samples/java-migration-copilot-samples

Resources

License

Stars

Watchers

Forks

Contributors