cancel
Showing results for 
Search instead for 
Did you mean: 

How to hold the messages in XI

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

Great thanks Liang.

Former Member
0 Kudos

@ Liang

I used UDF using following code, map it to root target node

Not a good design to implement message blockage within PI, especially mapping. Performance and resources are hit big time. Not a good recommendation but of course a nice solution

Former Member
0 Kudos

@ 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

Former Member
0 Kudos

@ 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.

Former Member
0 Kudos

dear all,

The best solution is to fail the messages in XI, and restart when ever you want them!!!

Fail them by deleting receiver agreement and it will fail in MONI saying like no receiver found

Then create Receiver agreement , activate it then re-start the messages from MONI

Regards

Former Member
0 Kudos

@ Vamsi

The best solution is to fail the messages in XI, and restart when ever you want them!!!

This is the poorest solution I have ever heard, especially because you will be deleting and creating receiver agreements all the time

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi

Long means its 2 days .and its not in producion to hold the messages its in Quality system.

Thx,

Amar

Former Member
0 Kudos

Hi

Goto SXMB_ADM-> manage queues and derigester the queues

it will hold the messages in queues until u register and activate them

Former Member
0 Kudos

Hi

Goto SXMB_ADM-> manage queues and derigester the queues

it will hold the messages in queues until u register and activate them