Skip to content

Conversation

vanitha1822
Copy link
Contributor

@vanitha1822 vanitha1822 commented Jan 8, 2025

📋 Description

JIRA ID:

While setting up the COMMON-API locally, some properties required to start the application were missing. The missing properties have been added to the application.properties file.


✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)

Summary by CodeRabbit

  • Configuration Updates
    • Added new configuration properties for various services
    • Introduced scheduling settings for data synchronization
    • Set up configuration for NHM agent, Everwell calendar, and CTI data sync
    • Defined retry and page size configurations
    • Implemented new cron schedulers for different system tasks

Copy link
Contributor

coderabbitai bot commented Jan 8, 2025

Walkthrough

The pull request introduces a comprehensive set of configuration properties in the application.properties file. These additions focus on enhancing scheduling and data synchronization capabilities for various services, including NHM agent real-time data, CTI data sync, Avni registration, Everwell calendar, and other system-level configurations. The new properties define URL endpoints, cron schedules, data retrieval limits, and feature toggles for different system components.

Changes

File Changes
src/main/resources/application.properties - Added multiple scheduler configuration properties
- Introduced new data synchronization settings
- Set limits and durations for various services
- Defined cron schedules for different system tasks

Poem

🐰 Config Rabbit's Scheduling Song 🕰️

Properties dance, a configuration delight,
Cron jobs spinning with algorithmic might,
Sync and schedule, with limits so neat,
Rabbit's code makes the system complete!

Hop, hop, configure! 🚀


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

sonarqubecloud bot commented Jan 8, 2025

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (4)
src/main/resources/application.properties (4)

191-193: Improve configuration clarity with proper documentation

The cz-duration=40 property lacks:

  • Unit specification (seconds, minutes, hours?)
  • Purpose documentation
  • Validation constraints

Add comments to clarify the purpose and unit:

##CTI data sync schedular
+# Duration in minutes for CTI data synchronization
+# Allowed range: 30-120 minutes
cz-duration=40

197-202: Document configuration constraints and units

The following properties need better documentation:

  • everwellCalendarDuration=15 - Missing unit specification
  • lonicPageSize=10 - Missing validation constraints

Add documentation for clarity:

##duration for everwell calender
+# Duration in days for Everwell calendar data retention
+# Recommended range: 7-30 days
everwellCalendarDuration=15

##lonic variables
+# Number of items per page for Lonic data pagination
+# Recommended range: 10-50 items
lonicPageSize=10

203-205: Document retry strategy

The callRetryConfiguration=3 property would benefit from documentation about:

  • Retry intervals
  • Backoff strategy
  • Timeout settings

Add comprehensive retry documentation:

#call retry count
+# Maximum number of retry attempts for failed calls
+# Note: Uses exponential backoff with 1s initial delay
+# Related properties:
+#   - call.retry.initial.delay.ms=1000
+#   - call.retry.max.delay.ms=5000
callRetryConfiguration=3

211-214: Review scheduler timing conflicts

Multiple schedulers are configured to run around midnight:

  • CTI data check: 0 10 00 * * * (12:10 AM)
  • NHM dashboard: 0 1 * * * ? * (12:01 AM)

This clustering of jobs around midnight could:

  • Cause resource contention
  • Impact system performance
  • Lead to potential deadlocks or timeouts

Consider:

  1. Distributing the jobs across different time windows
  2. Implementing a queue-based approach for job execution
  3. Adding timeout configurations for each scheduler

Also applies to: 228-230

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cc77f01 and 8d2bb51.

📒 Files selected for processing (1)
  • src/main/resources/application.properties (1 hunks)
🔇 Additional comments (2)
src/main/resources/application.properties (2)

188-189: Review the polling frequency for NHM agent data

The current cron schedule (0 */2 * ? * *) polls every 2 minutes, which might be:

  • Too frequent for the system's needs
  • Resource-intensive over time
  • Potentially causing unnecessary load on the target system

Could you confirm if this polling frequency is actually required? Consider increasing the interval if real-time data is not critical.


217-219: Optimize high-frequency scheduler configurations

The following schedulers have very frequent execution intervals:

  • Avni registration: Every 1 minute (0 0/1 * * * ? *)
  • Everwell data sync: Every 5 minutes (0 0/5 * * * ? *)

Please confirm if such high-frequency scheduling is necessary. Consider:

  1. Implementing event-driven processing instead of frequent polling
  2. Using message queues for real-time data synchronization
  3. Increasing intervals if real-time processing is not critical

Run this script to analyze the impact of these schedulers:

Also applies to: 225-227

avniRegistrationLimit=7

#--------------------------NHM Agent Real Time Data----------------------------
nhm.agent.real.time.data.url= http://175.101.1.83/apps/utility/alive_api.php
Copy link
Contributor

@coderabbitai coderabbitai bot Jan 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Replace hardcoded IP address with configurable hostname

Using a hardcoded IP address (175.101.1.83) is not recommended as it:

  • Makes environment switching difficult
  • Creates maintenance overhead
  • Could pose security risks if exposed in version control

Consider using a placeholder and moving the actual value to environment-specific configuration:

-nhm.agent.real.time.data.url= http://175.101.1.83/apps/utility/alive_api.php
+nhm.agent.real.time.data.url=${NHM_AGENT_HOST}/apps/utility/alive_api.php
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
nhm.agent.real.time.data.url= http://175.101.1.83/apps/utility/alive_api.php
nhm.agent.real.time.data.url=${NHM_AGENT_HOST}/apps/utility/alive_api.php

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@drtechie this link needs to be reviewed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

@drtechie
Copy link
Member

@Asp-irin do these cover the additional properties you are trying to add in #149 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants