Lingo
  1. Lingo
  2. LINGO-23

making an async call to a service prevents subsequent calls to server from being made

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.1
    • Fix Version/s: 1.1
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Making an async call to a service prevents subsequent calls from being made prior to when the asyn method on the server completes execution.

      Consider the Lingo test case org.logicblaze.lingo.example.ExampleTest#testClient

      Change the deplay in ExampleServiceImpl.asyncRequestResponse(String stock, ResultListener listener) to 35 seconds.

      public void testClient() throws Exception

      { // START SNIPPET: simple // lets lookup the client in Spring // (we could be using DI here instead) ExampleService service = (ExampleService) getBean("client"); // regular synchronous request-response int i = service.regularRPC("Foo"); System.out.println("Found result: " + i); // async request-response TestResultListener listener = new TestResultListener(); service.asyncRequestResponse("IBM", listener); //------------> sanjiv : new test code int ret = service.regularRPC("foo"); System.out.println("return value is " + ret); //------------> sanjiv : end new test code // the server side will now invoke the listener // objects's methods asynchronously // END SNIPPET: simple listener.waitForAsyncResponses(2); System.out.println("Found results: " + listener.getResults()); }

      In the example above, the async call is made (which runs for 35 seconds on the "server"). However when the next call of "ret = service.regularRPC("foo");" is made on the client, it blocks and eventaully times out.

      If we call an asynchronous call instead of service.regularRPC, that message is never received by the server.

      This is the same behaviour when the destination is a Queue or a Topic.

        Activity

        Hide
        Sanjiv Jivan added a comment -

        The issue was that org.logicblaze.lingo.jms.JmsServiceExporter uses a single JMS session which is single-threaded for consuming messages and executes message listeners serially. Using Spring 2.0's DefaultMessageListenerContainer or a JCA container like Jenks on the server side creates a session pool for message consumption which resolves the reported issue.

        I've documented this in my blog entry : http://jroller.com/page/sjivan?entry=asynchronous_calls_and_callbacks_using

        Closing issue.

        Show
        Sanjiv Jivan added a comment - The issue was that org.logicblaze.lingo.jms.JmsServiceExporter uses a single JMS session which is single-threaded for consuming messages and executes message listeners serially. Using Spring 2.0's DefaultMessageListenerContainer or a JCA container like Jenks on the server side creates a session pool for message consumption which resolves the reported issue. I've documented this in my blog entry : http://jroller.com/page/sjivan?entry=asynchronous_calls_and_callbacks_using Closing issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Sanjiv Jivan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: