web stats
Custom web service with Parallel Message Processing - Mirth Community

Go Back   Mirth Community > Mirth Connect > Development

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-02-2016, 04:08 AM
canessetu canessetu is offline
What's HL7?
 
Join Date: Jun 2016
Location: Rome
Posts: 1
canessetu is on a distinguished road
Send a message via Skype™ to canessetu
Question Custom web service with Parallel Message Processing

I need to develope a custom search/retrive web service that manages concurrent requests processing.

Using the new feature 'Parallel Message Processing' of Mirth 3.4.0.8000, I tried developing it setting 'Max Processing Thread' parameter to 100.

I tested performance whith Jmeter tool with:
Number of Thread(Users): 100
Ramp-up period : 2 sec
Loop Count: Forever


Observing Mirth dashboard some requests have concurrent execution but in Jmeter results latency time between request and response increases exponentially.
First Request latency time is 5000 ms
Last Request latency time is 12000 ms


Discovering in com.mirth.connect.connectors.ws.WebServiceReceiver class I found that HttpServer has backlog and poolthread size both set to 5.
Original source code from line 138 to 147:

Code:
        try {
            configuration.configureReceiver(this);
            server.bind(new InetSocketAddress(host, port), 5);
        } catch (Exception e) {
            throw new ConnectorTaskException("Error creating HTTP Server.", e);
        }

        executor = Executors.newFixedThreadPool(5);
        server.setExecutor(executor);
        server.start();
Replacing 'backlog' and 'poolthread size' with the same value as 'Max Processing Thread'.

Code:
        try {
            configuration.configureReceiver(this);
            server.bind(new InetSocketAddress(host, port), connectorProperties.getSourceConnectorProperties().getProcessingThreads());
        } catch (Exception e) {
            throw new ConnectorTaskException("Error creating HTTP Server.", e);
        }

        executor = Executors.newFixedThreadPool(connectorProperties.getSourceConnectorProperties().getProcessingThreads());
        server.setExecutor(executor);
        server.start();
Repeting the same test with Jmeter the code works with a constant latency time in every request.

About backlog configuration watch 'Note about socket backlogs'


Is this a proper way to develope it?
Is it dangerous?
Reply With Quote
 

Tags
concurrent, custom web service, multi threads, request, webservice

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 01:05 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation