cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver Time error in adapter Module in PI 7.31

Former Member
0 Kudos

Hello Team,

I am trying working on adapter module that accomplish Message id, Sender Interface name,Receiver Interface name sent time and receiver time.

I got all values in my file except receiver time .I have failed to get exact receiver time.

sent time shows as 2014 04 24 05:28:57

receiver time as 1969 12 31 19:00:00

when ever message triggers  its shows same receiver time(1969 12 31 19:00:00) ,I have placed my adapter module in JMS and File adapters,but i am getting same time in message receiver time .

Please help me how to get exact message receiver time.

Here is code.

Message msg1=null;

obj=md.getPrincipalData();

  msg1=(Message)obj;

msg1=(Message)md.getPrincipalData();

Date date = new Date();//For dynamic date file generation

  //time sent

  Long timesent=msg1.getTimeSent();

  Date sdate = new Date(timesent);

  Format Tformat = new SimpleDateFormat("yyyy MM dd HH:mm:ss");

  String SentTime=Tformat.format(sdate).toString();

  //time receive

  Long timerecev=msg1.getTimeReceived();

  Date rdate = new Date(timerecev);

  String ReceiveTime=Tformat.format(rdate).toString();

Thanks

Ganesh

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ,

For file you can get it as below

String sentTime = msg.getMessageProperty("http://sap.com/xi/XI/System/File", "SourceFileTimestamp"); 


For JMS try the below and let me know.

String sentTime = msg.getMessageProperty("http://sap.com/xi/XI/System/JMS", "DCJMSTimestamp"); 


Regards

Venkat

Former Member
0 Kudos

Hi Venkat,

Thanks for your response,

I  have requirement of receiver message time stamp.in separate file which was created by the Adapter Module.In communication channel monitor i got time as 2014 04 24 05:25:57,but in generated file it shows as 1969 12 31 19:00:00 wrong time.

here is my file generated by adapter module.


SentTime-->2014 04 24 05:25:57

ReceiveTime-->1969 12 31 19:00:00

Regards

Ganesh

Former Member
0 Kudos

Hi venkat,

I have placed

String sentTime = msg.getMessageProperty("http://sap.com/xi/XI/System/File", "SourceFileTimestamp");  in adapter module.

its showing sentTime as null.

can you please guide me for any  alternative way for getting receiver time stamp.

Thanks

Ganesh