Skip to content

Commit

Permalink
Threaded (#339)
Browse files Browse the repository at this point in the history
* Fix incorrect param for max threads

* Make parallel processing configurable through properties

* Hold mockito back because it is compiled with JDK11 in V5
  • Loading branch information
uhurusurfa authored Sep 12, 2023
1 parent 62cd9a3 commit 672f7d8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion Server/src/config/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
pollerConfigBase.defaults="sender.as2_id=$partnership.sender.as2_id$, receiver.as2_id=$partnership.receiver.as2_id$"
pollerConfigBase.sendfilename="true"
pollerConfigBase.mimetype="application/EDI-X12"
pollerConfigBase.process_files_in_paralllel="false"
pollerConfigBase.max_parallel_files="20"
partnerships.polling.interval="120"
messages.polling.interval="120"
/>
Expand Down Expand Up @@ -236,7 +238,9 @@
interval="$properties.pollerConfigBase.interval$"
defaults="$properties.pollerConfigBase.defaults$"
sendfilename="$properties.pollerConfigBase.sendfilename$"
mimetype="$properties.pollerConfigBase.mimetype$"/>
mimetype="$properties.pollerConfigBase.mimetype$"
process_files_in_paralllel="$properties.pollerConfigBase.process_files_in_paralllel$"
max_parallel_files="$properties.pollerConfigBase.max_parallel_files$"/>
<partnerships classname="org.openas2.partner.XMLPartnershipFactory"
filename="$properties.partnership_file$"
interval="$properties.partnerships.polling.interval$"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void init(Session session, Map<String, String> options) throws OpenAS2Exc
IOUtil.getDirectoryFile(sentDir);
}
processFilesAsThreads = getParameter(PARAM_PROCESS_IN_PARALLEL, "false").equalsIgnoreCase("true");
maxProcessingThreads = getParameterInt(PARAM_PROCESS_IN_PARALLEL, false, maxProcessingThreads);
maxProcessingThreads = getParameterInt(PARAM_MAX_PARALLEL_FILES, false, maxProcessingThreads);
if (processFilesAsThreads) {
// Create the thread pool
executorService = Executors.newFixedThreadPool(maxProcessingThreads);
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<!-- Hold at version 4.x for Java 8 compatibility -->
<version>5.5.0</version>
<version>4.11.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<!-- Hold at version 4.x for Java 8 compatibility -->
<version>5.5.0</version>
<version>4.11.0</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hamcrest/hamcrest -->
Expand Down

0 comments on commit 672f7d8

Please sign in to comment.