on 09-24-2010 2:44 PM
Hello Experts,
There are some messages coming into XI in the form of TLOGs. so i just want hold the all XML messages in XI for long time. could somone explain is there any procedure to hold the messages in XI .
I gone through the below SDN forum. but could someone suggest any otherway or procedure plz.
/people/alexander.bundschuh/blog/2006/01/04/scheduling-messages-in-sap-xi
Thx,
Amar
I implemented a scenario similar like yours here:
You can reference my solution: my requirements is that all the messages received after saying 9:00pm, will be hold until 12:00am to process, and it should not block any other interface processing:
I used UDF using following code, map it to root target node
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);
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(endTime - currTime); //delay 10 min
}catch (InterruptedException ie)
{
System.out.println(ie.getMessage());
}
return a;
}
else
return a;
}
Edited by: Liang Ji on Sep 24, 2010 7:46 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@ PI Expert:
This way, message will be hold in the queue, as long as not very long time, it should not create negative impact to the system, just think of BPM, any message received will create instance of the process in the memory based on correlation.
If the correlation condition is not triggered, the instance will stay in memory and waiting...
My implementation has been running on the customer side for over 2 years.
Regards
Liang
@ Liang,
I guess you got me wrong ... I am not saying to use BPM, in fact I am saying that messages shouldn't be put on hold in PI. I believe you have put on hold the messages for 3 hrs but Amar wants it for 2 days. If it is for few hours, this approach is still do-able but for 2 days, I am not convinced to hold messages in PI
Regards.
i just want hold the all XML messages in XI for long time.
What do you mean by long time? How long you are referring to? Explain in details.
Just to let you know - holding messages within PI for a "long time" is not a good idea - it will be blocking lots of resources during that period.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.