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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
Expand all | Collapse all

Return all request to IS with a default response

  • 1.  Return all request to IS with a default response

    Posted 11/03/21 11:53 PM

    We sometime need lock legacy system for upgrade so we need block all request go inside.
    Is there anyway to config a default response for all request to IS when we need

    Thank you


    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Return all request to IS with a default response

    Posted 11/04/21 02:00 AM

    Quiesce Mode” was built for this purpose - see page 977 here (link).

    KM


    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: Return all request to IS with a default response

    Posted 11/04/21 02:36 AM

    I don’t mean maintainace of IS, IS still work but it return a default response with custom message for caller with all request.


    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: Return all request to IS with a default response

    Posted 11/04/21 03:04 AM

    Alright, you can create an HTTP Interceptor with pre and post-processing actions; more here (link) and here (link).

    KM


    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: Return all request to IS with a default response

    Posted 11/04/21 03:32 AM

    Thank you, but it need restart server and config to work, Is there anyway to turn on intercepter quick and easy like depend on value of a Global variable?

    We need in normal status, Interceptor do nothing, when maintainance Interceptor catch and process all request

    thank you


    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: Return all request to IS with a default response

    Posted 11/04/21 04:05 AM

    I have not tested the Interceptor, but it appears that restart is a one-time setup activity, when you deploy the JAR the first time. You should be able to turn the Interceptor on and off, without a restart after the first time -

    KM


    #Integration-Server-and-ESB
    #webMethods


  • 7.  RE: Return all request to IS with a default response

    Posted 11/04/21 05:00 AM

    As I read, the inteceptor not prevent request go to other system, it catch the request and process before sent back to client , is there anyway catch request and return immediately response.

    Second: I cannot see how to turn on/off interceptor without restart , can you share more info

    thank you


    #webMethods
    #Integration-Server-and-ESB


  • 8.  RE: Return all request to IS with a default response

    Posted 11/04/21 07:51 AM

    You’re right, looks like it’s read-only with additional actions, but not a reroute.
    I’ll check if there are other custom/external options, but I need more time.

    @John_Carter4, any thoughts?

    KM


    #Integration-Server-and-ESB
    #webMethods


  • 9.  RE: Return all request to IS with a default response

    Posted 11/04/21 08:14 AM

    Hi,

    since you’re not going to handle the requests, do you really need to accept them? Maybe you just need to disable the http port (keep one active for admin).

    Best
    Bruno


    #Integration-Server-and-ESB
    #webMethods


  • 10.  RE: Return all request to IS with a default response

    Posted 11/04/21 09:25 PM

    Yes, we not handle request but we want send back a message to caller to notify them my system is maintainance ,
    and sometime we not disable all request , maybe filter by service name to return default response, other service still work as normal


    #webMethods
    #Integration-Server-and-ESB


  • 11.  RE: Return all request to IS with a default response

    Posted 11/05/21 04:03 AM

    The interceptor is allowed to throw an Exception to stop the request going further. Specifically it allows you to throw a HttpInterceptorException, which allows you to set both the http response code and message.
    e.g.

    throw new HttpInterceptorException(“Sorry, this server is temporarily unavailable”, 503);

    I would recommend providing a public service to allow your interceptor to then decide to go into maintenance mode so that you don’t have to register/unregister it each time you want to use it, nor have to restart the server.

    If you package your interceptor in a small package (recommended), you can place the jar in the packages code/jars/static folder. You could even develop a user friendly home page (dsp) to allow the administrator to activate/deactivate the interceptor and even customise the message.

    John.


    #Integration-Server-and-ESB
    #webMethods


  • 12.  RE: Return all request to IS with a default response

    Posted 11/07/21 10:37 AM

    Can you explain more how to “activate/deactivate the interceptor” , is IS provide function to do that?
    As I know , after we register interceptor then all request will catch by interceptor

    Thank you


    #Integration-Server-and-ESB
    #webMethods


  • 13.  RE: Return all request to IS with a default response

    Posted 11/07/21 02:59 PM

    You would explicitly add it to you java code i.e. use a global parameter that the interceptor would check to see if it should intercept or not.
    John.


    #Integration-Server-and-ESB
    #webMethods