Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-2049

Improper configuration of MINA connector and acceptor instances; Better producer

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.0
    • 1.6.2, 2.0.0, 2.1.0
    • camel-mina
    • None
    • Windows XP

    • Patch Available

    Description

      A sample scenario where both MINA producer(s) and consumer(s) are used in the same route (e.g. some kind of dispatching or proxying):

      from("mina:tcp://localhost:8888?lazySessionCreation=true&sync=true")
      .to("mina:tcp://localhost:7777?lazySessionCreation=true&sync=true");

      from("mina:tcp://localhost:7777?lazySessionCreation=true&sync=true")
      .process(/prepare answer/);

      Due to improper configuration of MINA acceptor and connector instances in MinaComponent#createSocketEndpoint(), no more than 15 incoming threads can be served at port 8888 – the producer becomes unable to open an outgoing session. This is actually an issue of MINA, not of Camel – a test application written using "raw" MINA shows the same behaviour.

      A solution is to apply configuration rules described, e.g., at http://mina.apache.org/configuring-thread-model.html, as done in the attached patch.

      Moreover, the standard Camel-MINA producer is not thread-safe – actually a well-known point. A second attached file contains a thread pool-based reentrant version, which can be efficiently used for TCP endpoints with both parameters 'lazySessionCreation' and 'sync' set to true.

      Attachments

        1. MinaSocketProducer.java
          7 kB
          Dmytro Rud
        2. MinaComponent.patch
          3 kB
          Dmytro Rud
        3. 2009-10-06.patch
          15 kB
          Dmytro Rud

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            davsclaus Claus Ibsen
            rnd Dmytro Rud
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment