Problems trying to correlate BAM over multiple Send Ports RRS feed

  • General discussion

  • I am having an issue with BAM in BizTalk 2010.  I have a Messaging only solution using 3 Receive Ports and 3 Send Ports.  The Processing received an XML file which contains Inventory updates for product items.  The flow is as follows:

    1) Receive a file via a send port.  The file is mapped via an inboud map to canonical form which includes inbound filename. The inbound message contains a DocumentId.

    2) Send msg file via a send port filtered on 1). This port demotes the source filename into the outbound message.

    3) Receive the file written by 2).  Flatten the message on into multiple records and strip the file path from the source file name.  This means each record is the same with the exception of PartNumber and Inventory Level.

    4) Send the message received by 3) to a SQL database via the WCF-Custom adapter.  The Adapter calls a stored procedure that reads the flattened messages out of the XML and inserts them into a Staging table.

    5) A WCF-SQL receive port reads the messages 1024 at a time from the staging table and submits them to the MessageBox.

    6) A WCF-SQL send port filters the messages received from 5) and submits them to another database which updates inventory figures.

    I have a BAM Activity which records:

       DocumentId, VendorId,  TotalItemsProcessed, InboundFileName, ReceivedTime, PreProcessedTime, StagedTime, and ProcessedTime.

       DocumentId, VendorId, TotalItemsProcessed are read from the inbound message on 1)

       InboundFileName is read from inbound message on 3)

       ReceivedTime - PortEndTime on 1)

       PreProcessedTime - PortEndTime on 2)

       InboundFileName - InboundFileName on Message received on 3)

      StagedTime - PortEndTime on 4)

       ProcessedTime - PortEndTime on 6)

    Because there are multiple ports I have to create multiple continuations in the TPE.  They are as follows:

    Cont1 - InterchangeId on ReceivePort for 1)

    Cont1 - InterchageId on Send Port for 2)

    I believe this should get me all the text data items except InboundFileName, ReceivedTime, and PreProcessedTime

    Cont2 - DocumentId from 1)

    Cont2 - DocumentId from 3)

    This should get me the InboundFileName

    Cont3 - InterchangeId from 3)

    Cont3 - InterchangeId from 4)

    This should be me the StagedTime

    Cont4 -  InterchangeId from 5)

    Cont4 - InterchangeId from 6)

    My problem is - everything seems to work except Cont4.  I query the <ActivityName>_AllInstances Vew in BAMPrimaryImport.  I see a record with all the data except ProcessedTime with a single ActivityId.  It records the ProcessedTime in the  table but under a different ActivityId.  I can look in the TrackedMessageEvents and see the messages for 5) and 6).  They have the same InterchangeId.  I even used one of the text data items to record the InterchangeId of the 6) message and it was the same as 5) except for the GUID was lowercase versus uppercase in MessageTracking.

    I am at a loss and would appreciate any help.

    Tuesday, December 16, 2014 8:17 PM

All replies

  • In messaging solution its not possible to calculate the time duration.

    Praj Dixit

    • Edited by PrajaktD Wednesday, December 17, 2014 11:51 AM
    Wednesday, December 17, 2014 11:46 AM
  • I am not calculating a time duration.  I am reporting the Port End Time.  Merely a measure.  That is not the problem.  As I stated, I am getting the port end time, just in a separate record. 

    Wednesday, December 17, 2014 2:44 PM