Qpid
  1. Qpid
  2. QPID-3784

Add special JVM environment variable to run dispatcher thread as daemon/non deamon depending from its value.

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.15
    • Fix Version/s: 0.15
    • Component/s: Java Client
    • Labels:
      None

      Description

      Dispatcher thread needs be set daemon/non-daemon depending of new configuration option to allow manipulating this behaviour.

      Historically, for the 0-8/0-9/0-9-1 client the use of Mina kept the
      JVM alive when a MessageListener was set, allowing asynchronous
      delivery to continue without the user having taken any explicit action
      to keep the JVM alive. Since we removed Mina this is no longer the
      case, and if there are no non-daemon threads then the JVM will now
      exit even though the user has set a MessageListener set. Investigating
      other providers suggests the typical behaviour is to make use of
      non-daemon threads by default, preventing this happening, but allowing
      users who desire that behaviour to configure it as such.

      For example, tibco seem to do exactly what I am proposing with their
      Dispatcher threads:
      https://docs.tibco.com/pub/enterprise_message_service/6.1.0-august-2011/doc/html/tib_ems_api_reference/api/javadoc/com/tibco/tibjms/Tibjms.html#PROP_DAEMON_DISPATCHER

      ActiveMQ seems to control this through transport options, defaulting
      to non-daemon threads with an option to reconfigure it:
      http://activemq.apache.org/tcp-transport-reference.html

        Activity

        Robbie Gemmell made changes -
        Status Ready To Review [ 10006 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Robbie Gemmell added a comment -

        Patch applied (with a tiny subsequent change to move a constant).

        Show
        Robbie Gemmell added a comment - Patch applied (with a tiny subsequent change to move a constant).
        Alex Rudyy made changes -
        Status In Progress [ 3 ] Ready To Review [ 10006 ]
        Alex Rudyy made changes -
        Assignee Alex Rudyy [ alex.rufous ] Robbie Gemmell [ gemmellr ]
        Hide
        Alex Rudyy added a comment -

        Robbie,

        Could you have a look again into an updated patch?

        I added a description of "qpid.jms.daemon.dispatcher" property into docs , updated test to extend QpidTestCase, and fixed compilation issues caused by recent changes.

        Show
        Alex Rudyy added a comment - Robbie, Could you have a look again into an updated patch? I added a description of "qpid.jms.daemon.dispatcher" property into docs , updated test to extend QpidTestCase, and fixed compilation issues caused by recent changes.
        Alex Rudyy made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Alex Rudyy made changes -
        Alex Rudyy made changes -
        Attachment 0001-QPID-3784-Introduce-JVM-env-variable-to-run-a-dispat.patch [ 12511983 ]
        Robbie Gemmell made changes -
        Status Ready To Review [ 10006 ] Open [ 1 ]
        Assignee Robbie Gemmell [ gemmellr ] Alex Rudyy [ alex.rufous ]
        Hide
        Robbie Gemmell added a comment -

        The change itself looks reasonable, but I agree with keith we should document the property in the guide. Also, there have been various code updates since the patch was created (my bad) including some to field accesses that mean the patch needs updated. Finally, QpidTestCase provides system property setting/unsetting utilities, I think the test would look cleaner if it was updated to use those.

        Show
        Robbie Gemmell added a comment - The change itself looks reasonable, but I agree with keith we should document the property in the guide. Also, there have been various code updates since the patch was created (my bad) including some to field accesses that mean the patch needs updated. Finally, QpidTestCase provides system property setting/unsetting utilities, I think the test would look cleaner if it was updated to use those.
        Hide
        Keith Wall added a comment -

        I think we should document the new parameter in the Programming in Apache Qpid docbook. Also it might be worth pointing out in this JIRA that this patch will revert the default behaviour back to that of Qpid 0.12.

        Show
        Keith Wall added a comment - I think we should document the new parameter in the Programming in Apache Qpid docbook. Also it might be worth pointing out in this JIRA that this patch will revert the default behaviour back to that of Qpid 0.12.
        Alex Rudyy made changes -
        Assignee Alex Rudyy [ alex.rufous ] Robbie Gemmell [ gemmellr ]
        Hide
        Alex Rudyy added a comment -

        Hi Robbie,

        Do you mind to review and commit the patch attached?

        Show
        Alex Rudyy added a comment - Hi Robbie, Do you mind to review and commit the patch attached?
        Alex Rudyy made changes -
        Status In Progress [ 3 ] Ready To Review [ 10006 ]
        Alex Rudyy made changes -
        Attachment 0001-QPID-3784-Introduce-JVM-env-variable-to-run-a-dispat.patch [ 12511983 ]
        Hide
        Alex Rudyy added a comment -

        A patch with an implementation and test is added

        Show
        Alex Rudyy added a comment - A patch with an implementation and test is added
        Alex Rudyy made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Alex Rudyy made changes -
        Field Original Value New Value
        Assignee Alex Rudyy [ alex.rufous ]
        Alex Rudyy created issue -

          People

          • Assignee:
            Robbie Gemmell
            Reporter:
            Alex Rudyy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development