IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Email notification for service errors

  • 1.  Email notification for service errors

    Posted Thu September 23, 2021 05:18 PM

    We’re using webMethods version 10.5 and configured email notification in Integration server–>Resources to get alert email in case of service exception, however it’s not returning parent service details. So, it’s hard to find which service is throwing exception out of 100 of flow service using addInt in this example. Is there anyway to get parent service details ?


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 2.  RE: Email notification for service errors

    Posted Fri September 24, 2021 01:56 AM

    Hi,

    Don’t you have more information at server.log?
    It is good practice to implement try/catch section in the flow code.
    In the catch section use: pub.flow:getLastError that would return the error that cause the problem
    Then you can use pub.flow:debugLog to store the error into server.log.

    In that case it is easy to see what flow is having problems.

    Regards,
    Łukasz Konkol


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: Email notification for service errors

    Posted Fri September 24, 2021 08:21 AM

    Hi,

    please remember that pub.flow:getLastError needs to be the first step in the catch block, otherwise the error informations is not available for further processing.

    Regards,
    Holger


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: Email notification for service errors

    Posted Fri September 24, 2021 09:25 AM

    Hi @surendra_Gollapudi ,
    It appears that the message sent to the service email is not customizable.

    Currently, I’m assuming that there are already hundreds of services without the try catch mechanism and modifying all of them is not an option. And you would like to find the service that is throwing this error.
    If you have access to error logs/ service logs , you should be able to find the source of the error since the details of the services executed will be present in these logs.

    -NP


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 5.  RE: Email notification for service errors

    Posted Fri September 24, 2021 11:41 AM

    Addendum:

    With the service name stated in the logs you can do a “Find dependents” in Designer and you will find all these services which are invoking addInts.

    You can check these invocations for missing map to num2.

    Regards
    Holger


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 6.  RE: Email notification for service errors

    Posted Fri September 24, 2021 03:40 PM

    Hi Holger, Thank you for responding. I would like to know if it’s possible to get the main service details instead of checking dependants. addInt error is just an example I provided for simplification purpose. We’re not actually using it without providing input :slight_smile:

    Thanks,
    Surendra.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 7.  RE: Email notification for service errors

    Posted Sat September 25, 2021 01:48 AM

    Most likely you are doing mapping from variable that is not populated and that throws exception.
    If you’ve got try/catch section implemented - I’m not sure what is a problem to check more details at the server log …
    As I understand (I’ve never used that functionality myself) notification just send email in case of error to notify you about the problem on the server. Checking where is the problem should be done by some error handling implementation that you should do on your own.
    If you’ve got try/catch section it is not problem to check logs for more details …
    Still - if you would see error - you would check logs to see which service was cause of it.

    In other hand - in most of the companies I’ve been working - the companies has it owns error handling implemented. The error handling has been added to catch section (after getLastError) and would do exactly what you want. So in this case it could just send email with full description of the issue. That could be customized and could send all kind of information.
    If you’ve got 50+ servers in PRD … it won’t be possible to check if from the notification that you are using :slight_smile:

    Regards,
    Łukasz Konkol


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 8.  RE: Email notification for service errors

    Posted Fri September 24, 2021 03:30 PM

    Hi @Nagendra_Prasad - Thank you for your response. We have implemented try/catch mechanism in all of our flow services. We get getLastError error dump in email notification as you can see in screen shot attached above, but not the parent service details.

    Thanks,
    Surendra.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 9.  RE: Email notification for service errors

    Posted Tue September 28, 2021 03:43 AM

    Can you please share a sample flow service to show the implementation of the TRY/CATCH and the getLastError as a screenshot perhaps , there might be some modifications to the services/constructs used that might help you?


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 10.  RE: Email notification for service errors

    Posted Tue September 28, 2021 04:37 AM

    Here it is:
    image

    Server log row from that service:
    2021-09-28 09:36:02 BST [ISP.0090.0004E] Default._202109.Konki:serviceExample – java.lang.ArithmeticException: / by zero


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 11.  RE: Email notification for service errors

    Posted Tue September 28, 2021 05:24 AM

    Here the error is “handled” already in the Catch block. If you go MWS and look the execution up, you’ll see that your service shows “Completed”, though it failed at divideInts.

    At the end of the Catch block (still within), add an Exit step, set it to exit from $flow and signal FAILURE, and map the actual error message from getLastError. Does this now show the parent service as failed, in the email notification?

    Note - Adding this Exit step comes with certain changes in behavious; for example, if your service is directly invoked by a UI; the actual internal error message will show up on the UI.

    KM


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 12.  RE: Email notification for service errors

    Posted Thu October 07, 2021 09:40 PM

    Hi @surendra_Gollapudi,

    for the missing parameter issue, normally will happen when

    1. totally no data to map into num2 variable
    2. early dropping of the variable that map into num2 in a loop case

    The things can be done is checking the server log to see any hint it happen in which services.
    I not sure how is the services design, maybe 100 services at the end point to a common email service?
    The another thing that can check is put savefiletopipeline service every end of the 100 services, test those services and check in the folder for the pipeline been saved.

    Hope this may help you.

    Thanks


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB