web stats
Split messages for multiple send - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-07-2011, 11:07 PM
Java4Fun Java4Fun is offline
Mirth Newb
 
Join Date: Feb 2011
Posts: 11
Java4Fun is on a distinguished road
Default Split messages for multiple send

Hello,

i've got a little problem.
(In every Transformer i use jscript - because of some specific tracing)
In the Soure Transformer i read from a database. (approx. 210k entries and more)
If i read all at once my memory seems to be explode and it takes more than 30 minutes for the first 21k entries.
If i clear the "storage-variable" every 5k entries it takes the half of the time to read. (and in addition my memory usage is tolerable).

Is there a way to send the tmp variable every 5k entries ?

thanks for your regards.
Yours Java4Fun

Edit: some numbers changed.

Last edited by Java4Fun; 03-07-2011 at 11:19 PM.
Reply With Quote
  #2  
Old 03-09-2011, 12:30 AM
Java4Fun Java4Fun is offline
Mirth Newb
 
Join Date: Feb 2011
Posts: 11
Java4Fun is on a distinguished road
Default

Update:
splitting the message into "packs" done with
"router.routeMessage(<channelName>,<data>);"

But the next problem is the Problem with PermGen.
I want to read 210k Entries and my permGen is after the first 5000 entries at max.

is there a solution to clear the permGen ?

The interresting Code:

Code:
//database connection...
// select statement -> write result to var result
var storeage_tmp = tmp;
var data = "";
for(x = 0;  result.next(); x++){
 data = result.getString(1);
 tmp['data'+x]['xyz'] = data;
 if( x% 1000 == 00 && x > 0){
  x = -1;
  router.routeMessage('mychannel', tmp);
  tmp = storeage_tmp;
   sleep(1000);
 }
}
router.routeMessage('mychannel', tmp);
sleep is a user defined global function.

thanks for your help.
Reply With Quote
Reply

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 10:27 PM.


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