Announcement Announcement Module
Collapse
No announcement yet.
HTTPInvoker nested calls? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • HTTPInvoker nested calls?

    Hello,
    I am using HTTPInvoker for communication between my components, which are loaded by Tomcat as seperate .war files. It works just fine, but it does not seem to be able to handle nested calls (i.e. A calls B(passes interface to A), and B calls back to A before completing). So far I have to schedule callbacks to occur later (i.e. A calls B, B schedules callback to A for some time later).
    Are nested calling scenarios not supported with HTTP Invoker.

    Thanks much,
    -- David

  • #2
    it does not seem to be able to handle nested calls
    What behavior do you see?

    passes interface to A
    Is this a callback interface or an endpoint reference? Since HTTP invoker sends serialized objects (not the objects themselves) you can't really invoke a method on a remote object (passed as a parameter to an HTTPInvoker call).

    You might be experiencing deadlock because HTTP is a synchronous (request/response) protocol, especially if your A object has synchronized methods.

    Code:
    A --- request(serialize(interface to A)) ----> B
    + wait for reponse....
                     <---- request ----------------------  +
                                                                 wait for reponse....

    Comment


    • #3
      Thank you for your reply.
      An example would be a bunch of "function providers" that register with a coreService.
      Provider's application-config.xml creates a proxy to the coreService using its URI, interface class, and HttpInvokerProxyFactoryBean. Provider then calls coreService to register (passing its provider URI) and before completing the registration call, coreService wants to create a dynamic proxy for the provider and ask it some questions.
      In this context, the callback to the provider just never seems to occur. So far I can only get this to work if I start a thread in the coreService to call the provider back later, after the register call completes. Hope I explained clearly enough...

      Comment


      • #4
        So you are instantiating HttpInvokerProxyFactoryBean each time a function provider registers?

        When creating are you:
        - using a multi-threaded HttpClient with CommonsHttpInvokerRequestExecutor?
        - calling afterPropertiesSet()?

        BTW: This approach will likely be difficult to get to work from within an application server if you are using HTTPS endpoints. Outgoing SSL doesn't usually work well from inside application servers -- it usually ends up conflicting with the app servers SSL implementation.

        Comment

        Working...
        X