Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-1435

UIMA AS client creates too many JMS connections to a broker

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3AS, 2.4.0AS
    • Component/s: Async Scaleout
    • Labels:
      None

      Description

      Currently, a JMS Connection is created for every instance of UIMA AS client. When scaling UIMA AS client in the same JVM, this results in many connections to the same Broker. As optimization, the first instance of UIMA AS client should create a single connection to the broker and store it in a static data structure. Subsequent UIMA AS client instances should reuse the connection to create JMS sessions. The connection will be closed when all client instances call stop() method.

        Activity

        Hide
        cwiklik Jerry Cwiklik added a comment -

        Updated the code to enable reuse of a cached JMS connection. The first instance of UIMA AS client creates the connection and stores it in a static SharedConnection object. This object maintains the JMS Connection as well as total number of UIMA AS clients. Every time a client calls initialize() method, the SharedConnection object increments the client counter. Every time a client calls stop(), the counter is decremented. When the count reaches 0, the connection is closed. This change reduces number of threads the broker needs to manage.

        Show
        cwiklik Jerry Cwiklik added a comment - Updated the code to enable reuse of a cached JMS connection. The first instance of UIMA AS client creates the connection and stores it in a static SharedConnection object. This object maintains the JMS Connection as well as total number of UIMA AS clients. Every time a client calls initialize() method, the SharedConnection object increments the client counter. Every time a client calls stop(), the counter is decremented. When the count reaches 0, the connection is closed. This change reduces number of threads the broker needs to manage.
        Hide
        cwiklik Jerry Cwiklik added a comment -

        Multiple UIMA AS clients deployed in the same JVM share a single JMS Connection to a Broker.

        Show
        cwiklik Jerry Cwiklik added a comment - Multiple UIMA AS clients deployed in the same JVM share a single JMS Connection to a Broker.
        Hide
        cwiklik Jerry Cwiklik added a comment -

        The optimization implemented here should be parametrized to allow deployment of multiple UIMA AS clients in the same jvm, each connecting to a different broker. Current code does not allow it.

        Show
        cwiklik Jerry Cwiklik added a comment - The optimization implemented here should be parametrized to allow deployment of multiple UIMA AS clients in the same jvm, each connecting to a different broker. Current code does not allow it.
        Hide
        cwiklik Jerry Cwiklik added a comment -

        Modified UIMA AS client side to allow multiple connections to brokers. Previously only one connection was allowed preventing an application from deploying multiple UIMA AS client instances, each connecting to a different broker. The client manages a pool of connections now. Added a new test case to test support for this new feature.

        Show
        cwiklik Jerry Cwiklik added a comment - Modified UIMA AS client side to allow multiple connections to brokers. Previously only one connection was allowed preventing an application from deploying multiple UIMA AS client instances, each connecting to a different broker. The client manages a pool of connections now. Added a new test case to test support for this new feature.

          People

          • Assignee:
            cwiklik Jerry Cwiklik
            Reporter:
            cwiklik Jerry Cwiklik
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development