none
Multiple Receive Port in an Orchestration RRS feed

  • Question

  • Hello, 

    I have 2 receive ports in my orchestration, 1 to receive a WCF-SQL data and the other one is to receive files from a folder.

    I set the WCF-SQL receive message to true and when I compile my application I got the following error.

    Severity Code Description Project File Line Suppression State
    Error you must specify at least one already-initialized correlation set for a non-activation receive that is on a non-selfcorrelating port

    Looks like BizTalk does not allow 2 or more receive ports/messages in an orchestration.

    Please advise.

    Thanks. 


    Wednesday, February 8, 2017 9:19 PM

Answers

All replies

  • Hi ,

    On your first receive shape ,set activation property to True.

    There is one more consideration ,instead of bounding your first receive shape with  typed message (SQL server message)  you can try using untyped message of type xmldocument and put filter condition on your first receive shape based on BTS.Receiveport or BTS.Messagetpye with OR condition on filter expression.

    Thanks

    Abhishek


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply

    Thursday, February 9, 2017 12:46 AM
  • Hi,

    Basically, for an orchestration with multiple receive ports, you have to specify which receive shape(s) will fire up a new orchestration when a new message is delivered to it. For messages that will not lead to a new orchestration instance (meaning that they will be delivered to an already existing instance), you have to specify how they relate to the instantiated orchestrations. Latter correlation will come into play, and for an example you can look Parallel Convoys and Sequential Convoys.

    If you need both messages in your orchestration and they come in in a undefined order, you will need a parallel shape with two receive shapes in it. Both receive shapes must be activated and initialize the same correlation set. Refer: Parallel Convoy in BizTalk example

    If your orchestration is always started using a message from the first port and the second port will add another message to the orchestration later on, you will have just one receive port on the top, also activated and initializing a correlation set and a second one somewhere below just following the correlation set. Refer: Walkthrough: Correlations in BizTalk Orchestration

    If you need just one message but you don't know what port will deliver this message i.e.  if you need any of the message (whichever received first) should kick of the orchestration without waiting for the other one, in that case you need to use Listen shape. Refer: http://www.c-sharpcorner.com/UploadFile/john_charles/receiving-messages-with-multiple-schemas-in-a-single-orchestration/



    Rachit Sikroria (Microsoft Azure MVP)

    Thursday, February 9, 2017 2:15 AM
    Moderator
  • It's perfectly fine to have as many Receive Ports as you need.

    But if you have two Receive Shapes connected, one must Activate, the others must have a Following Correlation Set.

    Can you post a picture?  It's difficult to describe these situations.


    Thursday, February 9, 2017 1:24 PM
    Moderator

  • Hi,

    What my application does?

    My application intends to read the SQL database to check if the integration feeds file are ready for process. The SQL select statement returns an xml data format containing the runID. I  transformed the xml I'm receiving from SQL into another schema(schema-2) ,I promoted the runID of schema-2 and used in my decide shape (runID > 0) then run my listener with 2 receive messages.


    Below is my orchestration.

    SQLReceivePort - receives information from the SQL database, select statement.

    ReceiveFeedsFilePort - receives reads xml files from a folder using file adapter.

    I put a DummyReceivePort to implement the listener the I put in my orchestration.
    DummyReceivePort will not do anything-- I'm not sure if this is how to implement this??

    Please suggest other way around to implement this case. Thanks.


    I set all the receive ports to active = true and I got the following error.

    Error

    an activatable receive must be the first executable statement in a service

    Thursday, February 9, 2017 2:06 PM
  • So, this process will not work, sorry.

    "read the SQL database to check if the integration feeds file are ready for process"

    For that, you need to Poll the database and start the process then.

    Thursday, February 9, 2017 4:59 PM
    Moderator
  • Is there any other way around to fulfill what my application is supposed to do?

    I'm checking correlation mechanism.. Do you think this would do it?

    Thursday, February 9, 2017 6:00 PM
  • Yes, by polling the database.  There has to be something to trigger the process.

    The pattern you have just won't work, sorry.  It's quite easy to start over with a Polling Operation that check the database for whatever condition is necessary.

    Is the data already in the database or do you really need to read files?

    Thursday, February 9, 2017 6:26 PM
    Moderator
  • I found a third party scheduled task adapter. I think this something that I would use to fulfill my objective.

    Is there a native Microsoft BizTalk adapter available? 

    http://biztalkscheduledtask.codeplex.com/

    Thursday, February 9, 2017 6:33 PM
  • Well, no.  That will not help you, sorry.

    "read the SQL database to check if the integration feeds file are ready for process"

    If that is the case, you have to start by polling the database for the ready flag.

    Same question, is the data in the database or will you be reading files?

    Thursday, February 9, 2017 6:41 PM
    Moderator
  • I will be reading files. The result from the database will just to tell when the file adapter should read the files from the folder.
    Thursday, February 9, 2017 6:58 PM
  • That's a very strange pattern.  Why can't you just read the files directly?

    Meaning, what purpose does the database flag serve?

    Thursday, February 9, 2017 7:10 PM
    Moderator
  • We have to group the files before sending to the other location (using SFTP). Those are integration files. The files are created using SSIS. Then we use BizTalk to read the files (File Adapter) then transfer the files to another location (SFTP). But before running the file and SFTP adapters, I need to check the runID I get from SQL.

    If we need to send the file one at a time then it's not an issue.

    Thursday, February 9, 2017 8:18 PM
  • What would typically be done is SSIS prepares the files completely, then BizTalk does whatever it needs.

    What exactly does the "runID" tell you that you need to act on?

    Thursday, February 9, 2017 9:37 PM
    Moderator
  • It's a business logic that tells if runID >0,  SSIS is done creating the group of files so BizTalk could start picking up the files. The files need to be transferred by group.

    Thursday, February 9, 2017 9:50 PM
  • Ok, I think you should solve this in a different way.  This sounds similar to situations I've seen.

    Rather the runID concept, which really just complicates things, modify the SSIS Package to stage the files itself.

    Meaning, it runs and produces all its files as now, but add one more step to move all the completed files at once to the BizTalk pickup location.

    That way, there's no out of band coordination.

    Friday, February 10, 2017 12:46 PM
    Moderator
  • We will implement the application based on your advice.

    Thanks a lot!

    Monday, February 13, 2017 5:17 PM
  • Please mark the Answers that were Helpful or an Answer.
    Monday, February 13, 2017 6:00 PM
    Moderator