none
How to do exception handling if SAP port fails or not available BizTalk Server 2006 RRS feed

  • Question

  • Hi All,

    I have a query how can i do exception handling if SAP port is not working.As there is hugh number of xml's are getting processed every two hours (around 500). And those xml's i don't want to get suspended, because then there will be manual activity to resend the xml's.

    I am thinking if i can drop to some folder and then reinitiate it after some time..

    Please suggest me with solution..


    -- Kind Regards Sandeep
    Wednesday, July 13, 2011 11:16 AM

All replies

  • Hi,

    You can consider turning failed message routing on on the BizTalk send port to SAP. Create an additional file send port with a subscription on those failed messages to route them to a folder.

     


    HTH,

    Randal van Splunteren 2 x MVP BizTalk Server, MCTS BizTalk Server
    my blog

    Check out the PowerShell provider for BizTalk
    Please mark as answered if this answers your question.
    Wednesday, July 13, 2011 12:32 PM
    Moderator
  • Hi Randal,

    Thanks for your reply.

    But my business requirment is to resumit the messages when SAP port is available..

    How should i achieve this..


    -- Kind Regards Sandeep
    Wednesday, July 13, 2011 1:24 PM
  • Hi,

    You can set the number of retries and retry interval on the send port properties to a higher value? This would mean the send port will retry if the SAP is not accessible or available for a number of times.

     


    HTH,

    Randal van Splunteren 2 x MVP BizTalk Server, MCTS BizTalk Server
    my blog

    Check out the PowerShell provider for BizTalk
    Please mark as answered if this answers your question.
    Wednesday, July 13, 2011 1:41 PM
    Moderator
  • Hi Randal,

    But whould it be advisable if number of messages are high say more than 1000 messages in an hour.

    Would it be any performance issue..


    -- Kind Regards Sandeep
    Wednesday, July 13, 2011 1:44 PM
  • First thing hit me is why the sap port is not working. One thing you can check is concurrent connection allowed property should be set to 0 i.e. unlimited. SAP Adapter should be able to handle huge frequency with ease. However if you want to have resubmit mechanism then you can use Failed message routing and set a send port to subscribe all the message based on Error.ErrorType and send port and send it to one file folder. Then you can schedule a job to resubmit the files for processing (you would also need to have one receive location to receive resubmitted files).
    Regards, Ajeet Kumar MCTS Biztalk Server
    Thursday, July 14, 2011 9:55 AM
  • Hi Ajeet,

    Thanks for your reply.

    I am only thinking in terms of exception handling..sometime SAP port is not reachable like network connectivity fails or if SAP is down for upgrade or maintenance.

    So as there is web based application which user uses and data send to folder which is remote share folder and Biztalk is polling this folder and consumes the xml and then send to SAP.

    So in times of exception, users will not be knowing of error and all messages are getting retried at SAP port so for this scenario i was thinking of exception handling.

    I am thinking if SAP port fails i should notify once to admin and resubmit the message once SAP port starts working.

    So that least manual intervention will be there.

    Pls Advise..

     


    -- Kind Regards Sandeep
    Thursday, July 14, 2011 10:07 AM
  • For such kind of scenario, I would set DeliveryNotification property at send port (refer this). Be sure to catch DeliveryException and General exception and then you can send the failed message to one folder for resubmit at later stage.
    Regards, Ajeet Kumar MCTS Biztalk Server
    Thursday, August 4, 2011 11:06 AM
  • Hi Ajeet,

    Thanks for your reply.

    So suppose if SAP port is not available then by routing failed messages to a specified folder.

    Then how should i schedule to resubmit the messages.

    As there are more than 50 SAP RFC's for which 50 orchestrations are build.

    Please advise how can i encorporate in orchestration.

     

     


    -- Kind Regards Sandeep
    Saturday, August 27, 2011 4:20 AM
  • You can keep a scheduled task port to look at this resubmit folder and let it submit the files to the actual process after a predefined time. Look at this Scheduled Task Adapter if you want to automate.

     


    Cheers,
    Bali
    MCTS: BizTalk Server 2010,BizTalk Server 2006 and WCF
    -----------------------------------------------------
    Mark As Answer or Vote As Helpful if this helps.
    Saturday, August 27, 2011 7:35 AM
  • Hi bali,

     Thanks for your reply..

    I will look for the schedular to resubmit the files.

    Could you please advise when i do exception handling what Exception Object type i should use when in scenario where SAP is under maintenance or no reachable.

     

     


    -- Kind Regards Sandeep
    Saturday, August 27, 2011 10:48 AM
  • You can use the GeneralException and also do a small test by to doing a mock test and catch the specific Exception too.

     


    Cheers,
    Bali
    MCTS: BizTalk Server 2010,BizTalk Server 2006 and WCF
    -----------------------------------------------------
    Mark As Answer or Vote As Helpful if this helps.
    • Edited by DPS Bali Saturday, August 27, 2011 11:50 AM .
    Saturday, August 27, 2011 11:49 AM
  • Hi Bali,

    Thanks for your reply.

    So if i do exception handling inside orchestration then i cannot use property of SAP port to retry for some time.

     

    Pls advise what would be the best practice to handle file when SAP port is not available or SAP port gives some error ..in my case where large number of files need to be pushed to SAP around 1 lakh files a day.


    -- Kind Regards Sandeep
    Saturday, August 27, 2011 1:58 PM
  • Sandeep,

    A few questions regarding your requirement

    1) How much time do you think you SAP system will be down in one go.

    2) If you are processing 1 lakh files per day, what is the system expected to do in case you get an error from business standpoint. Do you need to alert someone like a system admin or SAP support team.

    3) What are the other exception cases that you are contemplating other than the SAP system being down.

    Lets hear from you on these and then may be we can help you with choosing the best possible solution.

     


    Cheers,
    Bali
    MCTS: BizTalk Server 2010,BizTalk Server 2006 and WCF
    -----------------------------------------------------
    Mark As Answer or Vote As Helpful if this helps.
    Saturday, August 27, 2011 3:51 PM
  • Hi Bali,

    Thanks for you reply.

    1) I would expect maximum 4 hrs at one go..that would be occasionally. Only thing is that as traffic of files are high and if suppose during biztalk sending xml to SAP port and there is network failure. Then i want to handle that situation.

    2)Yes as data is high and crucial so it should be notified to some admin that SAP is down or there is some issue with network. (I thought of sending mail if there is some problem in SAP port but for every file instance that many mails will shoot to admin which i want to avoid, admin will be expecting single mail from biztalk informing about the situation).

    3) As there are 60 SAP RFC for which 60 orchestrations build and whose receive ports are remote network share so i worry if number of files are high will this going to disrupt network share, will biztalk be able to process files.

    Please advise so that i can develop and deliver good solution to client.

    Thanks in advance

     

     

     


    -- Kind Regards Sandeep
    Saturday, August 27, 2011 6:36 PM
  • Hi Sandeep,

    I think you already have the idea of the verious exception handling mechanisms that you have at hand. Just a brief of what I think can be the ways to handle your exceptions.

    1) Handling the exception with the Orchestration, will give you control as to how you want to route the message in case of a prolonged failure and close the existing process without 100s and 1000s of suspended messages. For this your retry count at port level has to be 0.

    2) Failed message routing at port level. Again you will not have a lot of suspended messages. With this also you can route the failed messages in case of a failure. For this to work out-of-box your retry count at port level has to be 0

    Think these are the best for you to route your failed messages whether it is a failed messages folder location or a retry queue(MSMQ).

    Now the second part is the way to handle the failed messages. This again depends on your process. You can generate an alert periodically from your failed folder location or failed message queue if you dont want to flood peoples mailboxes in case of a prolonged failure. Also you can schedule the retry for failed messages by a separate port which will keep polling at these messages periodically and resubmit them to the actual process without any manual intervention. You can use the Schedule Task adapter I mentioned earlier for doing this.

    Hope this will help.

     


    Cheers,
    Bali
    MCTS: BizTalk Server 2010,BizTalk Server 2006 and WCF
    -----------------------------------------------------
    Mark As Answer or Vote As Helpful if this helps.
    Monday, August 29, 2011 5:34 AM
  • Hi Bali

    Thanks for your reply..

    Pls advise how can i send email to concerend person only once in case SAP is not available.

    Also in my other post i mentioned that when i do exception handling i am able to divert message to failed messages folder, but still i see suspended message in biztalk administration.

    Pls advise..

     


    -- Kind Regards Sandeep
    Monday, August 29, 2011 7:17 AM
  • Hi Sandeep,

    Sending one email will be a challenge, you might have to send an email alert periodically based on the failure. I did a setup where in we send an email alert every 4 hours to the BizTalk Admin of the count of messages in the failure queue(MSMQ) and if the count is > 100 we send it to a larger group.

    You will have to figure this out with IT support group of your client and take it as a NFR as to how they want to handle this.

    About the suspended messages, not sure what these messages are. Check these message in the admin console and is their ErrorType property present. If so may be you will have to re-look at the filter which handles failed messages.

     


    Cheers,
    Bali
    MCTS: BizTalk Server 2010,BizTalk Server 2006 and WCF
    -----------------------------------------------------
    Mark As Answer or Vote As Helpful if this helps.
    • Edited by DPS Bali Monday, August 29, 2011 9:21 AM .
    Monday, August 29, 2011 9:20 AM
  • Hi Bali,

    Thanks for your reply.

    I am not using filter in send port for SAP .

    I am doing exception handling in orchestration and the message is the same which i am sending to SAP port.

    Follwing things i did for exception handling

    1. Set the retry-count to 0 on your physical request-response port which i use to bind.
    2. Enable Routing of failed messages for SAP physical port.
    3. In orchestration scope set Synchronised property to "true" and transaction type property to "none".
    4. Enable the flag Delivery Notification to 'Transmitted' on logical request-response port within the orchestration.
    5. Catch the "System.Web.Services.Protocols.SoapException"  
    6. To test i set some invalid IP of SAP

    Pls advise


    -- Kind Regards Sandeep
    Monday, August 29, 2011 12:07 PM
  • I think you are on the right track, however I would remove the #2 as that wouldn't add much value if you are handling the exception in the Orchestration
    Cheers,
    Bali
    MCTS: BizTalk Server 2010,BizTalk Server 2006 and WCF
    -----------------------------------------------------
    Mark As Answer or Vote As Helpful if this helps.
    Monday, August 29, 2011 12:51 PM
  • Hi Bali ,

    I tried that ..but no luck still i see message getting suspended.

    Also pls advise if i want to implement solution of sending mails to admin in case of SAP ort failure, using POP3 adapter inside orchestration won't be benefical as this will fillup the mailbox.

    So when i dump file to "Failed Messages" folder can i count number of messages in it on todays date and send email ..for this i am thinking of new orchestraion to be build.

    Pls advise..


    -- Kind Regards Sandeep
    Monday, August 29, 2011 4:51 PM
  • any luck find the properties on these suspended messages as I described in a previous post. Also you will be better of doing the email in a separate orchestration. You should think about using a table or a MSMQ for failed messages rather than a file location . Would be better doing the email and re-processing if required 
    Cheers,
    Bali
    MCTS: BizTalk Server 2010,BizTalk Server 2006 and WCF
    -----------------------------------------------------
    Mark As Answer or Vote As Helpful if this helps.
    Monday, August 29, 2011 6:42 PM
  • Hi Bali,

    Will try with the new orchestration for email,..pls correct if i am wrong you mean by saying "table or a MSMQ for failed messages rather than a file location" that i should store messages to MSMQ or SQ table rather than file location.

    Because in above post you said"

    Think these are the best for you to route your failed messages whether it is a failed messages folder location or a retry queue(MSMQ)."

    Pls advise..


    -- Kind Regards Sandeep
    Tuesday, August 30, 2011 4:15 AM
  • Yes you got it right. However if you want to keep a backup of the files, you can do both keep the files in file location and metadata for emails and re-processing in a SQL table.

     


    Cheers,
    Bali
    MCTS: BizTalk Server 2010,BizTalk Server 2006 and WCF
    -----------------------------------------------------
    Mark As Answer or Vote As Helpful if this helps.
    Tuesday, August 30, 2011 4:59 AM
  • Hi Bali,

    The problem i was facing in dev server when message is suspended when i am doing exception handling for it. i read about this in aticle

    http://blogs.msdn.com/b/kevinsmi/archive/2004/07/03/172574.aspx

    where it mentions that only way to catch exception is to capture NACK Negative Acknowledgement

    and capturing Error Description element in NACK message.

    Pls would this be the reason that message is suspended.


    -- Kind Regards Sandeep
    Tuesday, August 30, 2011 6:40 AM
  • If you are handling the exception and in the exception block sending the message to failure queue/table/folder , ideally you should not see any suspended messages. Can you check the properties of this suspended message in the console and see what is this message. Also check in case of an exception your flow is going into the exception block. Just that you are using using delivery notification that should also be the cause of the suspended messages. Check this blog post for details on delivery notification usage.
    Cheers,
    Bali
    MCTS: BizTalk Server 2010,BizTalk Server 2006 and WCF
    -----------------------------------------------------
    Mark As Answer or Vote As Helpful if this helps.
    • Edited by DPS Bali Tuesday, August 30, 2011 7:35 AM added link
    Tuesday, August 30, 2011 7:28 AM
  • Hi Bali,

    below is the error i see in event viewer

    A message sent to adapter "SAP" on send port "SendPort_SAP" with URI "sap://AS:10.000.1.000/00/900/" is suspended.

    Error details: Connect to SAP gateway failed

    Connect_PM GWHOST=10.000.1.000, GWSERV=sapgw00, ASHOST=10.000.1.000, SYSNR=00

    LOCATION CPIC (TCP/IP) on local host

    ERROR partner not reached (host 10.0.1.0, service 3300)

    TIME Tue Aug 30 17:44:03 2011

    RELEASE 620

    COMPONENT NI (network interface)

    VERSION 36

    RC -10

    MODULE ninti.c

    LINE 979

    DETAIL NiPConnect2

    SYSTEM CALL SO_ERROR

    ERRNO 10060

    ERRNO TEXT WSAETIMEDOUT: Connection timed out

    COUNTER 1

     

    MessageId: {56BA8B95-A45A-48EA-B8D7-E4EC0D55C5EA}

    InstanceID: {97A98F51-A1D6-4808-B489-17EC973D967C}


    -- Kind Regards Sandeep
    Tuesday, August 30, 2011 12:11 PM
  • Hi Sandeep,

    I would suggest remove the delivery notification and then try the same scenario.

     


    Cheers,
    Bali
    MCTS: BizTalk Server 2010,BizTalk Server 2006 and WCF
    -----------------------------------------------------
    Mark As Answer or Vote As Helpful if this helps.
    Tuesday, August 30, 2011 4:36 PM
  • Hi Bali,

    Removed Delivery notification exception handling block and tested, now again i see message getting suspended with error in event log as

    A message sent to adapter "SAP" on send port "SendPort_SAP" with URI "sap://AS:10.000.1.000/00/900/" is suspended.

    Error details: Connect to SAP gateway failed

    Connect_PM GWHOST=10.000.1.000, GWSERV=sapgw00, ASHOST=10.000.1.000, SYSNR=00

    LOCATION CPIC (TCP/IP) on local host

    ERROR partner not reached (host 10.0.1.0, service 3300)

    TIME Thu Sep 01 12:44:52 2011

    RELEASE 620

    COMPONENT NI (network interface)

    VERSION 36

    RC -10

    MODULE ninti.c

    LINE 979

    DETAIL NiPConnect2

    SYSTEM CALL SO_ERROR

    ERRNO 10060

    ERRNO TEXT WSAETIMEDOUT: Connection timed out

    COUNTER 1

    But exception handling also done on message.

    Pls advise why both is happening i.e error in event log and message getting suspended,..also able to drop file to failed messages folder


    -- Kind Regards Sandeep
    Thursday, September 1, 2011 8:33 AM
  • Hi Sandeep,

    If i get this right, I think you failed message routing is enabled on the physical port. You need to remove that option. When an error occurs you orchestration will take care of it. Try removing this option on the physical port.

     


    Cheers,
    Bali
    MCTS: BizTalk Server 2010,BizTalk Server 2006 and WCF
    -----------------------------------------------------
    Mark As Answer or Vote As Helpful if this helps.
    Monday, September 5, 2011 7:07 AM