Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: for the plan.

Jump to: navigation, search

Stardust/Knowledge Base/Integration/Camel/AMQ-OracleAQ-Bridge


Stardust allows specifying JMS applications where one can send a request message and receive a response message. Within Stardust, messages are sent and acknowledgement is received from the configured queues (request-response) However there may be situations where we need to connect or send messages from Active MQ to another Messaging protocol or service. Sending messages from Active MQ to Oracle AQ is one such example.


Active MQ 5.3

Camel JMS Component

The JMS component allows messages to be sent to (or consumed from) a JMS Queue or Topic. The implementation of the JMS Component uses Spring JMS support for declarative transactions using JmsTemplate for sending and MessageListenerContainer for consuming messages.

Oracle AQ (10g/11g)

Advanced Queuing leverages the functions of the Oracle database so that messages can be stored persistently, propagated between queues on different machines and databases, and transmitted using Oracle Net Services, HTTP(S), and SMTP.

Implementation Example

When triggered, a message is sent to the Active MQ Queue configured in the carnot-spring*.xml file and using one of the Transaction Managers. Then the messages are delegated to MQ topic and eventually to the Oracle Topic Configured in camel.xml. Messages are sent via this channel:
Active MQ Queue -> MQ Topic --> MQ Topic --> Oracle Topic

The following configurations are needed to activemq.xml to send messages over the ActiveMQ-Oracle AQ Bridge:

(This file can be found under <<Active MQ installed folder>>\apache-activemq-5.3.0\conf)

  • Specify the Oracle Topic Destination
<topic physicalName="OracleAQTopic"/>
  • Specify the Active MQ Queue Name and to forward topic name
<compositeQueue name="CarnotTestQueue" forwardOnly="false">
	<topic physicalName="OracleAQTopic"/>
  • Client Transport Connectors
            <transportConnector name="openwire" uri="tcp://"/>
  • Oracle AQ Connection Factory Bean with Credentials
<bean id="requiredBeanForOracleAq" class="org.apache.activemq.ActiveMQConnectionFactory" /> 
			        <!--topic connection-->
<bean id="connectionFactoryOracleAQTopic" class="oracle.jms.AQjmsFactory" factory-method="getQueueConnectionFactory"> 
<constructor-arg index="0"> 
<value>jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS=(protocol=tcp)(host=<hostname>)(port=1521)
(Connect_Data= (SERVICE_NAME = <servicename>))))
 <constructor-arg index="1" type="java.util.Properties"> <value></value> </constructor-arg>
<bean id="oracleTopicCredentials" class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter"> 
<property name="targetConnectionFactory"> <ref bean="connectionFactoryOracleAQTopic"/> </property> 
<property name="username"> <value><username></value> </property> 
 <property name="password"> <value><password></value> </property> 
<bean id="oracleTopic" class="org.apache.camel.component.jms.JmsComponent"> 
<property name="connectionFactory" ref="oracleTopicCredentials"/>
  • Import camel.xml in the activemq.xml
<import resource="camel.xml"/>

(Place this file under <<Active MQ installed folder>>\apache-activemq-5.3.0\conf) and add the following section to it

    <!-- Dependencies: ojdbc.jar and aqjms.jar must be in the activemq lib directory -->		    
     <from uri="activemq:topic:OracleAQTopic" /> 
     <to uri="oracleTopic:topic:topicname" />
  • Configure the camel Activemq component to use the current broker
<!-- configure the camel activemq component to use the current broker -->
    <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent" >
        <property name="connectionFactory">
          <bean class="org.apache.activemq.ActiveMQConnectionFactory">
            <property name="brokerURL" value="vm://localhost?create=false&waitForStart=10000" />
            <property name="userName" value="${activemq.username}"/>
            <property name="password" value="${activemq.password}"/>


Active MQ admin portal


Oracle AQ

Back to the top