This document outlines the development progress and configuration for the Webex Contact Center DB Connector project.
This is a Spring Boot application designed to integrate with Webex Contact Center using OAuth 2.0 authentication.
- Framework: Spring Boot 3.4.0
- Language: Java 24
- Build Tool: Maven
- Template Engine: Thymeleaf
- Security: Spring Security OAuth2 Client
- Scaffolded a standard Spring Boot application.
- Updated
pom.xmlto include necessary dependencies:spring-boot-starter-webspring-boot-starter-securityspring-boot-starter-oauth2-clientspring-boot-starter-thymeleaf
- Configured
application.propertieswith Webex OAuth2 provider details. - Scopes:
spark:people_read(Required to fetch user profile/name)
- Redirect URI: Configured as
{baseUrl}/login/oauth2/code/{registrationId}.- Note: The Webex Integration in the developer portal must have
http://localhost:8080/login/oauth2/code/webexadded as a valid Redirect URI.
- Note: The Webex Integration in the developer portal must have
- Implemented a
SecurityFilterChain. - Public access allowed for:
/,/login**,/error**. - All other requests require authentication.
- Login Flow:
- Initiated via
/oauth2/authorization/webex. - On success, redirects to
/welcome.
- Initiated via
- Logout: Clears session and redirects to root
/.
/(Root): Checks authentication status.- If authenticated: Redirects to
/welcome. - If anonymous: Renders
index.html(Login page).
- If authenticated: Redirects to
/welcome: Displays a welcome message to the authenticated user./home: Displays detailed user attributes (Dashboard).
index.html: Simple landing page with a "Login with Webex" button.welcome.html: Post-login landing page.home.html: Debug view showing user details and attributes.
backup.sh: A shell script to:- Run
mvn clean. - Zip the project contents (excluding
.git) to a timestamped file in../webex-contact-center-dbconnectorV2_zip. - Run
mvn clean package -DskipTeststo verify the build after backup.
- Run
- Startup Logging:
DbConnectorApplication.javaimplementsCommandLineRunnerto print the calculated Redirect URI and Base URL to the console on startup for easier debugging.
- AOP Logging: Implemented
LoggingAspectto log execution time for all methods inApiController. - Logback Configuration: Customized
logback-spring.xmlto output logs tologs/app.logwith a specific pattern and rolling policy. - Logger Abbreviation: Configured log pattern to abbreviate package names (e.g.,
c.c.w.d.aspect.LoggingAspect) for cleaner output.
benchmark.py: A Python script to generate load on the API endpoints.- Sends 100 requests to a specified endpoint.
- Calculates and prints min, max, average, and median latency.
- Useful for verifying AOP logging and endpoint tracking.
- HikariCP Configuration: Explicitly configured connection pool settings in
application.properties:minimum-idle=5maximum-pool-size=20auto-commit=true
- H2 Database: Configured to run in file mode (
./data/dbconnector).
- Normalization:
EndpointTrackingInterceptorandEndpointTrackingServicenow strictly enforce lowercase storage for all endpoint URLs.- This prevents duplicate stats for the same endpoint accessed with different casing (e.g.,
/api/query/DEV/...vs/api/query/dev/...). - Ensures consistent aggregation of statistics on the dashboard.
- This prevents duplicate stats for the same endpoint accessed with different casing (e.g.,
- Ensure Java 24 is installed.
- Update
src/main/resources/application.propertieswith your validclient-idandclient-secret. - Run the application:
java -jar target/dbconnector-0.0.1-SNAPSHOT.jar
- Access the application at
http://localhost:8080.
To run the performance benchmark:
- Ensure the application is running.
- Execute the Python script:
python3 benchmark.py
To create a backup of the project:
./backup.sh