Retrieving the time stamp of the received message

819 views Asked by At

I could not figure how to retrieve the time stamp of the received messages. Based on the time the messages received I have to send emails to two different send ports. I understand how can I dynamically send the messages but dont know, how can I decide based on the time it arrives.

Can anyone help me with this. Thanks a lot.

2

There are 2 answers

6
Jeroen Maes On BEST ANSWER

Since you are using the File Adapter, you can read out the FileCreationTime Property of the http://schemas.microsoft.com/BizTalk/2003/file-properties NameSpace. This Property holds the DateTime when the file was created in the file location monitored by the adapter.

When you want the DateTime of the message when it was received in BizTalk, you should use the AdapterReceiveCompleteTime of the http://schemas.microsoft.com/BizTalk/2003/messagetracking-properties NameSpace.

enter image description here

1
zurebe-pieter On

There are several options:

Using the FILE adapter, you have a FileCreationTime property, set by the FILE adapter. This is not the timestamp of receiving, but might be sufficient for your cause.

enter image description here

If you need to have the EXACT timestamp when you received the file, you would need to create a custom pipeline component that either:

  • includes it in the message somewhere
  • or writes/promotes a property in the context of the message using DateTime.Now for example.

You can then use it in a mapping or content based routing somewhere.

I think these are your options.