Skip to content

Commit f98ea09

Browse files
committed
fixes #141: Make Archiver config configurable
These are the new properties and their defaults: conversation.archiver.conversation.max-work-queue-size default: 500 conversation.archiver.conversation.max-purge-interval default: 1000 (one second) conversation.archiver.conversation.grace-period default: 50 conversation.archiver.message.max-work-queue-size default: 500 conversation.archiver.message.max-purge-interval default: 1000 (one second) conversation.archiver.message.grace-period default: 50 conversation.archiver.participant.max-work-queue-size default: 500 conversation.archiver.participant.max-purge-interval default: 1000 (one second) conversation.archiver.participant.grace-period default: 50
1 parent 1247146 commit f98ea09

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

changelog.html

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ <h1>
5050
<li>[<a href='https://github.com/igniterealtime/openfire-monitoring-plugin/issues/137'>Issue #137</a>] - MUC messages duplicated as one-on-one messages</li>
5151
<li>[<a href='https://github.com/igniterealtime/openfire-monitoring-plugin/issues/138'>Issue #138</a>] - Stanzas not always stored for one-to-one messages whilst clustered</li>
5252
<li>[<a href='https://github.com/igniterealtime/openfire-monitoring-plugin/issues/139'>Issue #139</a>] - Reduce code complexity</li>
53+
<li>[<a href='https://github.com/igniterealtime/openfire-monitoring-plugin/issues/141'>Issue #141</a>] - Make Archiver configuration configurable</li>
5354
</ul>
5455

5556
<p><b>2.1.0</b> -- September 10, 2020</p>

src/java/org/jivesoftware/openfire/archive/ConversationManager.java

+16-4
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,11 @@ private static class ConversationArchivingRunnable extends Archiver<Conversation
10861086
{
10871087
ConversationArchivingRunnable( String id )
10881088
{
1089-
super( id, 500, Duration.ofSeconds( 1 ), Duration.ofMillis( 50 ) ); // TODO make values configurable.
1089+
super( id,
1090+
JiveGlobals.getIntProperty("conversation.archiver.conversation.max-work-queue-size", 500),
1091+
Duration.ofMillis( JiveGlobals.getLongProperty("conversation.archiver.conversation.max-purge-interval", 1000)),
1092+
Duration.ofMillis( JiveGlobals.getLongProperty("conversation.archiver.conversation.grace-period", 50))
1093+
);
10901094
}
10911095

10921096
protected void store( List<Conversation> workQueue )
@@ -1138,11 +1142,15 @@ protected void store( List<Conversation> workQueue )
11381142
/**
11391143
* Stores Messages in the database.
11401144
*/
1141-
private class MessageArchivingRunnable extends Archiver<ArchivedMessage>
1145+
private static class MessageArchivingRunnable extends Archiver<ArchivedMessage>
11421146
{
11431147
MessageArchivingRunnable( String id )
11441148
{
1145-
super( id, 500, Duration.ofSeconds( 1 ), Duration.ofMillis( 50 ) ); // TODO make values configurable.
1149+
super( id,
1150+
JiveGlobals.getIntProperty("conversation.archiver.message.max-work-queue-size", 500),
1151+
Duration.ofMillis( JiveGlobals.getLongProperty("conversation.archiver.message.max-purge-interval", 1000)),
1152+
Duration.ofMillis( JiveGlobals.getLongProperty("conversation.archiver.message.grace-period", 50))
1153+
);
11461154
}
11471155

11481156
@Override
@@ -1206,7 +1214,11 @@ private static class ParticipantArchivingRunnable extends Archiver<RoomParticipa
12061214
{
12071215
ParticipantArchivingRunnable( String id )
12081216
{
1209-
super( id, 500, Duration.ofSeconds( 1 ), Duration.ofMillis( 50 ) ); // TODO make values configurable.
1217+
super( id,
1218+
JiveGlobals.getIntProperty("conversation.archiver.participant.max-work-queue-size", 500),
1219+
Duration.ofMillis( JiveGlobals.getLongProperty("conversation.archiver.participant.max-purge-interval", 1000)),
1220+
Duration.ofMillis( JiveGlobals.getLongProperty("conversation.archiver.participant.grace-period", 50))
1221+
);
12101222
}
12111223

12121224
protected void store( List<RoomParticipant> workQueue )

0 commit comments

Comments
 (0)