Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
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.