on 10-04-2010 7:46 PM
Hello,
Scenario is: File -> PI -> IDoc
Is there a simple/light weight way to introduce a delay (about 10 min) between any two messages in the IE/mapping that are received simultaneously by a File Sender communication channel and converted to IDocs.
The BDC session that processes these IDocs is unable to handle 2 of them at once...
Thanks in advance,
Mustafa
HI,
Maintain QOS in sender communication channel as Exactly Once in Order, It should resolve the requirement.
Please let us know if it works.
Thanks,
Satya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Without BPM involvement, you can also introduce a UDF wich use Java Sleep() fucntion, which map to the target parent node,
this way, the mapping step will be hold whatever you specified. Combine this with EOIO option.
Regards
Liang
Edited by: Liang Ji on Oct 4, 2010 10:02 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Mustafa:
I did similar scenario, you can reference my code,
My requirements is that any messages received after 9:00pm will be hold until 12:00am to process.
Liang
public String CalendarDelay(String a,Container container){
// get the supported ids for GMT-05:00 (Pacific Standard Time)
String[] ids = TimeZone.getAvailableIDs(-5 * 60 * 60 * 1000);
// if no ids were returned, something is wrong. get out.
if (ids.length == 0)
System.exit(0);
//create a Pacific Standard Time time zone
SimpleTimeZone pdt = new SimpleTimeZone(-5 * 60 * 60 * 1000, ids[0]);
// set up rules for daylight savings time
pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
pdt.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
// create a GregorianCalendar with the Pacific Daylight time zone
// and the current date and time
Calendar calendar = new GregorianCalendar(pdt);
Date trialTime = new Date();
calendar.setTime(trialTime);
//currYear = Integer.toString(calendar.get(Calendar.YEAR));
//currMonth = Integer.toString(calendar.get(Calendar.MONTH));
//currDate = Integer.toString(calendar.get(Calendar.DATE));
int currYear = calendar.get(Calendar.YEAR);
int currMonth = calendar.get(Calendar.MONTH);
int currDate = calendar.get(Calendar.DATE);
Calendar StartCalendar = new GregorianCalendar(pdt);
Calendar EndCalendar = new GregorianCalendar(pdt);
StartCalendar.set(currYear, currMonth, currDate, 17, 30, 0);
EndCalendar.set(currYear, currMonth, currDate, 23, 59, 59);
long startTime = StartCalendar.getTimeInMillis();
long endTime = EndCalendar.getTimeInMillis();
long currTime = calendar.getTimeInMillis();
if ((currTime >= startTime) && (currTime <= endTime)){
//return "Current time fall into the range !";
try
{
//Thread.sleep(1000*60*10); //delay 10 min
Thread.sleep(endTime - currTime);
}catch (InterruptedException ie)
{
System.out.println(ie.getMessage());
}
return a;
}
else
return a;
}
Liang's suggestion works partly.... i.e. when you introduce 'wait' in MM - then each/every message coming thru gets delayed.... - this code in my opinion is unnecessary as you can mark the File Channel as "Automatic Control" under RWB-Adapter Monitoring and then add an entry on "Availaibity Times" when the Channel is to be temporarily stopped/inactive so nothing processes during that time.
The easiest way I found to interject a delay between any two consequent messages is thru the use - OS command -> /usr/bin/sleep <secs> on the "Run OS command After Message processing" attribute
Thanks all for valuable input on this one !
Mustafa
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.