Can you explain what you mean by "connected HornetQ to Oracle AQ queue" in more detail?
I don't really understand the question.
We are using Oracle AQ, and we would like HornetQ to consume messages from AQ. Ultimate goal would be to use JBoss AS with HornetQ and connect EJB3 MDB's to AQ with HornetQ.
This is not possible with more or less any enterprise messaging system.
Each messaging system has it's own underlying protocol which are not compatible between systems.
A HornetQ client connects to a HornetQ server.
A Weblogic JMS client connects to a Weblogic JMS server
A Oracle AQ client connects to a Oracle server
It's not possible for a client from one system to connect to another since they won't understand the protocol.
(This is being addresses to some extent with AMQP, but that is still emerging)
Perhaps what you really want to do is *bridge* messages from AQ to HornetQ?
This means you use a Oracle AQ client to consume messages from Oracle AQ, then you take that message and sent it to HornetQ.
At no point does a HornetQ client talk to a Oracle AQ server or an Oracle AQ client talk to a HornetQ server.
This should be possible using a JMS bridge- assuming Oracle AQ implements the JMS 1.1 specification properly. Although I haven't tried it with AQ
See the user manual for more details.
Thanks for correcting my terminology. JMS Bridge is exactly what I'm looking for. I'd love to hear if someone has successfully used it with AQ. With the help of oracle.jms.AQjmsFactory it should be doable.
Hi Pasi and Tim,
I struggled with this issue some time ago. Implementing the bridge is possible because Oracle Advanced Queuing is JMS 1.1 compliant but I found some problems.
The first task is to register your Oracle AQ queues, topics and connection factories in a LDAP server and lookup them using a JNDI connection. The obvious option is to use Oracle Internet Directory (OID), although using OpenLDAP is also possible, please visit these posts of Edwin Biemond's blog about how to do it: Using OpenLDAP for net8 and AQ connection factory and Lookup Oracle database queue (AQ) with jndi and LDAP.
I setup the bridge between a HornetQ 2.2.5 standalone installation and an Oracle 11.2 database, it ran properly with a DUPLICATES_OK quality of service, but when I tried to move to an ONCE_AND_ONLY_ONCE one, which requires XA, I got an NullPointerException:
oracle.jms.AQjmsException: Error creating the db_connection
After a research on Oracle Support notes, I found that the Oracle API has a bug (10102373) that it will be fixed on the future release 12.1 In my case, a bridge from HornetQ to Oracle AQ, I found a workaround: to save the JMS Message ID in a Oracle table and implement a unique index on that column, you have to take into account that the JMS Messege ID sent by HornetQ is a property that can be recovered with the method get_string_property of the Oracle type aq$_jms_message. Here you are an excerpt of my hornetq-beans.xml file:
<bean name="JMSBridge" class="org.hornetq.jms.bridge.impl.JMSBridgeImpl">
<!-- concatenate JMS messageID to the target's message header -->
<!-- TargetCFF describes the ConnectionFactory used to connect to the target destination -->
<bean name="TargetCFF" class="org.hornetq.jms.bridge.impl.JNDIConnectionFactoryFactory">
<inject bean="TargetJNDI" />
<!-- TargetDestinationFactory describes the Destination used as the target -->
<bean name="TargetDestinationFactory" class="org.hornetq.jms.bridge.impl.JNDIDestinationFactory">
<inject bean="TargetJNDI" />
<!-- JNDI is a Hashtable containing the JNDI properties required -->
<!-- to connect to the *target* JMS resources -->
<bean name="TargetJNDI" class="java.util.Hashtable">
<map class="java.util.Hashtable" keyClass="java.lang.String"
I also tried to setup the bridge using HornetQ deployed as the JMS provider of JBoss 6.0.0, but in this case it was unsuccessful, I didn't get any error but the messages never arrived to Oracle AQ. I reviewed all the logs of both JBoss and Oracle, but I couldn't find out the cause.