Bitronix does not support Topic/Queue interfaces

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Bitronix does not support Topic/Queue interfaces

Rasha
Hi,

It seems that bitronix does not handle topic sessions and queue sessions.
In fact, a quick look at the code shows that JmsConnectionHandle implements Connection only (not TopicConnection, queueConnection), and DualSessionWrapper implements Session only (not TopicSession, QueueSession).
I couldn't find any way to do "createPublisher" with the bitronix code. And if I try to do this using "twisted ways", like gettting the XAConnection from the JmsConnectionHandle, and then casting it, I get an error stating that the resource was not registered with the transaction. This makes perfect sense, since it is the DualSessionWrapper that is doing the enlist resource.

Will there be any support for these in the near future?
Bitronix has shown to be a great transaction manager so far, and it is a shame to have to drop it due to this issue, especially that competing implementations do support the above.

Feedback on this issue is highly appreciated.

Thanks
Rasha
Reply | Threaded
Open this post in threaded view
|

Re: Bitronix does not support Topic/Queue interfaces

Ludovic Orban
Administrator
Hi,

Indeed, BTM's JMS connection pool is a bit minimalistic. The queue and topic specific interfaces and methods you're speaking about are in my understanding JMS 1.0.2 leftovers kept for backward compatibility in JMS 1.1.

I agree there is no way to create a TopicSession and to call createPublisher on it obviously but it is possible to do the exact same  thing using JMS 1.1 API: call Session.createProducer() instead of TopicSession.createPublisher() and call MessageProducer.send() instead of TopicPublisher.publish().

If you're writing a new application from scratch, it is quite easy to make this change. If you're trying to integrate BTM in an existing application or trying to leverage some JMS library you've written before then changing this might not be doable.

In the latter case the only possibility would be to extend the current JMS pool to add support for Queue and Topic specific classes. This shouldn't be too hard but quite time consuming to update the test suite.
Reply | Threaded
Open this post in threaded view
|

Re: Bitronix does not support Topic/Queue interfaces

Rasha
Thanks for the quick reply,

I see your point concerning the deprecation of the topic and queue interfaces.

In fact, in my case, I am building a dependency injection framework, so I don't know how the user intends to use JMS beforehand.
FYI, I have been able to create a layer above BTM that wraps the topic and queue interfaces. I did so by wrapper the DualSessionWrapper and the JmsConnectionHandle, and adding a couple of wrappers for topic and queue connections.
It works great!

Thanks again for the feedback!


Ludovic Orban wrote
Hi,

Indeed, BTM's JMS connection pool is a bit minimalistic. The queue and topic specific interfaces and methods you're speaking about are in my understanding JMS 1.0.2 leftovers kept for backward compatibility in JMS 1.1.

I agree there is no way to create a TopicSession and to call createPublisher on it obviously but it is possible to do the exact same  thing using JMS 1.1 API: call Session.createProducer() instead of TopicSession.createPublisher() and call MessageProducer.send() instead of TopicPublisher.publish().

If you're writing a new application from scratch, it is quite easy to make this change. If you're trying to integrate BTM in an existing application or trying to leverage some JMS library you've written before then changing this might not be doable.

In the latter case the only possibility would be to extend the current JMS pool to add support for Queue and Topic specific classes. This shouldn't be too hard but quite time consuming to update the test suite.