locked
Delay the message send to sendport inside orchestration RRS feed

  • Question

  • I have an application where the BizTalk Orchestration Calls other orchestration. Once the called orchestration writes a files in to file share(completes the process), Calling Orchestration calls the web service. So it is like this

    So what happens is the files that is written by the called orchestration is bigger in size and takes sometime to complete it. But the Called orchestration assumes the process is complete and calls the service. I need to know if I can delay the call to the service.

    Wednesday, October 14, 2015 12:48 PM

All replies

  • Dont delay, because u r never sure what delay is sufficient. Try a different approch though

    If everything after ur call shape is actually working on how the called process went, try moving the decide logic to ur called orch. and instead of a call use a start orch.

    In the started orch when u r writing the file set delivery notification to true for the send port. In this way the process will go ahaed only when the delivery is successful else u can cathc the error and take necessary steps.


    Regards <br/> When you see answers and helpful posts,<br/> please click Vote As Helpful, Propose As Answer, and/or Mark As Answer


    Wednesday, October 14, 2015 1:04 PM
    Answerer
  • I dont want to make a big change because this is already in production. Does just the delivery notification on file send port is enough?
    Wednesday, October 14, 2015 1:06 PM
  • Then in ur called orch set the delivery notification property and return the result only when delivery is successful. This way ur parent orch will wait till the delivery is done and reported successful. And then call the service.

    Regards <br/> When you see answers and helpful posts,<br/> please click Vote As Helpful, Propose As Answer, and/or Mark As Answer


    Wednesday, October 14, 2015 1:07 PM
    Answerer
  • The solution provided by Pi_xel_xar is correct. But remember if you are using called orchestration and setting the Delivery Notification to true then  if something goes wrong in the Called Orchestration, catch the exception properly and send the results back to the calling orchestration so that it can resume.

    Otherwise you will end up in the having zombie messages.

    The other solution to have start orchestration and move the decide logic to called orchestration is good then

    Rahul

    Wednesday, October 14, 2015 2:27 PM
  • Does the Called Orchestration do anything other than Send the File to a File Send Port?  If so, using a Called Orchestration doesn't really get you much.

    Anyway, for clarity, yes, what you want is pretty easy and low touch as Pi_xel_xar has explained.  To expand, basically:

    • Put the Send Shape in a Scope with an Catch Block to trap DeliveryFailureException.
    • On the Orchestration Send Port, set the Delivery Notification property to Transmitted.

    The Send Shape will block until either the ACK or NACK is received, meaning the file is fully written.

    Wednesday, October 14, 2015 2:50 PM
    Moderator
  • This is how my called Orchestration looks (it again calls the other orchestrations)

    So you want me to put in every send shape in to the scope?? Does just the Delivery Notification on the Send ports Transmitted doesnot work?

    Wednesday, October 14, 2015 2:58 PM
  • Well, a Scope is not technically required, but if delivery fails, the exception will just bubble up until something catches it.

    Since Delivery Notification represents a very specific error, it should be caught at the lowest level possible, so yes, that means a Scope around every Send Shape that is connected to a Delivery Notification = Transmitted Port.

    Wednesday, October 14, 2015 3:26 PM
    Moderator
  • I am sorry Johns I am not able to follow. Do you want me to insert a scope shape or Just Delivery Notification = Transmitted will do the job.?? I am sorry
    Wednesday, October 14, 2015 3:49 PM
  • A scope as well. Because in scope handler u will cath deliverynotification failure exception..

    Have a look here.

    http://kentweare.blogspot.nl/2007/11/biztalk-delivery-notification.html


    Regards <br/> When you see answers and helpful posts,<br/> please click Vote As Helpful, Propose As Answer, and/or Mark As Answer

    Wednesday, October 14, 2015 4:46 PM
    Answerer
  • I made in all the called orchestration like,

    Inside expression I gave like System.Diagnostics.EventLog.WriteEntry("BizTalk.DataFeed", plprc.ErrorDescription);

    But what happens is

    Really in need of help.

    Wednesday, October 14, 2015 6:13 PM
  • not very clear whats ur problem actually is.. Explain a bit more ..

    Regards <br/> When you see answers and helpful posts,<br/> please click Vote As Helpful, Propose As Answer, and/or Mark As Answer

    Wednesday, October 14, 2015 6:20 PM
    Answerer
  • The correct thing to do is set Delivery Notification = Transmitted and place the Send Shape in a Scope with a Catch Block.

    Wednesday, October 14, 2015 6:31 PM
    Moderator
  • I have two parent orchestrations

    The Parent in application 1 calls the parent in application 2.The application 2 parent orch calls several small child orchestrations. Child orchestration in app 2 write a file in to file share (send port).So what happened was before the files are written complete the orch in app1 called the API.

    So as you recommended I inserted a scope shape and had catch exception handler for Microsoft.XLANGs.BaseTypes.DeliveryFailureException with send ports having the Transmitted as Delivery Notification.

    So now what happens if I run both the application the app2 parent orchestration goes to dehydrated stage like



    • Edited by Sid_2014 Wednesday, October 14, 2015 6:40 PM
    Wednesday, October 14, 2015 6:39 PM
  • John I did the same thing I put the send shape in scope and catch to use Microsoft.XLANGs.BaseTypes.DeliveryFailureException

    Next I made the send port Delivery Notification to Transmitted. Now the Orchestration that calls these child orchestration goes in to dehydrated state.

    Wednesday, October 14, 2015 6:46 PM
  • Are the files getting Written?
    Wednesday, October 14, 2015 6:51 PM
    Moderator
  • Yes It is written
    Wednesday, October 14, 2015 6:51 PM
  • This is what it shows when I check in Running Service Instance

    Wednesday, October 14, 2015 7:25 PM