Skip to content

Commit

Permalink
Merge pull request #6862 from ant-media/refactor-subscriber-for-mongodb
Browse files Browse the repository at this point in the history
Refactor Subscriber & Add setting to write events to datastore
  • Loading branch information
mekya authored Dec 8, 2024
2 parents 8e5543f + 4dfabcf commit e17a0ab
Show file tree
Hide file tree
Showing 18 changed files with 1,295 additions and 841 deletions.
25 changes: 25 additions & 0 deletions src/main/java/io/antmedia/AppSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,10 @@ public class AppSettings implements Serializable{
private int previewQuality = 75;


/**
* Whether to write viewers(HLS, WebRTC) count to the data store, it's true by default.
* If you set it to false, it decreases the number of write operations to the data store and you don't see the viewer count in datastore
*/
@Value( "${writeStatsToDatastore:${" + SETTINGS_WRITE_STATS_TO_DATASTORE +":true}}")
private boolean writeStatsToDatastore = true;

Expand Down Expand Up @@ -2326,6 +2330,13 @@ public boolean isWriteStatsToDatastore() {
*/
@Value("${encodingQueueSize:150}")
private int encodingQueueSize = 150;

/**
* Write subscriber events to datastore. It's false by default
* Subscriber events are when they are connected/disconnected. Alternatively, you can get these events from analytics logs by default
*/
@Value("${writeSubscriberEventsToDatastore:false}")
private boolean writeSubscriberEventsToDatastore = false;

//Make sure you have a default constructor because it's populated by MongoDB
public AppSettings() {
Expand Down Expand Up @@ -4066,4 +4077,18 @@ public int getPreviewQuality() {
public void setPreviewQuality(int previewQuality) {
this.previewQuality = previewQuality;
}

/**
* @return the writeSubscriberEventsToDatastore
*/
public boolean isWriteSubscriberEventsToDatastore() {
return writeSubscriberEventsToDatastore;
}

/**
* @param writeSubscriberEventsToDatastore the writeSubscriberEventsToDatastore to set
*/
public void setWriteSubscriberEventsToDatastore(boolean writeSubscriberEventsToDatastore) {
this.writeSubscriberEventsToDatastore = writeSubscriberEventsToDatastore;
}
}
Loading

0 comments on commit e17a0ab

Please sign in to comment.