Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-38

creating a producer inside an onMessage() causes deadlocks

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.1
    • None
    • None

    Description

      This one is from Gianny...

      I have encountered a major problem during the implementation:

      • I have one Connection C;
      • I create a Session S1 and one MessageConsumer MC1, which registers an asynchronous MessageListener ML1;
      • ML1.onMessage is called;
      • in the context of this invocation, I create a new Session S1 from C; and
      • then I create a MessageProducer from S1.

      This creation causes a deadlock as the various TransportChannel implementations, at least VmTransportChannel and TcpTransportChannel, dispatch the ML1.onMessage method in the same Thread that the one used to read incoming Packet. In other words, in the context of an onMessage method, one can not create some objects (e.g. MessageProducer, MessageConsumer), which need to be acknowledged (a Packet with ReceiptRequired). I do not understand why when creating a Session one does not need such an acknowledgement, though there is to be sure a very good reason. I had a look to the JMS specifications, and there are no restrictions on the above scenario.

      Attachments

        Activity

          People

            stewie Stewie
            jstrachan James Strachan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: