activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hurst (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AMQ-2455) Need a facility to retry jms connections to a foreign provider by the ActiveMQ JMS bridge.
Date Thu, 15 Apr 2010 13:10:46 GMT

    [ https://issues.apache.org/activemq/browse/AMQ-2455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58872#action_58872
] 

Andrew Hurst commented on AMQ-2455:
-----------------------------------

Applied the patch to activeMQ 5.3.0 and it works like magic (for QueueConnection). I tested
as follows:

1) Started my local broker and then using spring I setup a bridge to an OracleAQ remote broker
like so:

<bean id="bookingJmsFactory" class="oracle.jms.AQjmsFactory"
		factory-method="getQueueConnectionFactory">

		<!-- host -->
		<constructor-arg index="0">
			<value>${jms.external.etlp.host.address}</value>
		</constructor-arg>

		<!-- database id -->
		<constructor-arg index="1" type="java.lang.String">
			<value>${jms.external.etlp.database.id}</value>
		</constructor-arg>

		<!-- port number -->
		<constructor-arg index="2" type="int">
			<value>${jms.external.etlp.host.port}</value>
		</constructor-arg>

		<!-- database client mode -->
		<constructor-arg index="3">
			<value>${jms.external.etlp.database.driver}</value>
		</constructor-arg>
	</bean>

	<!-- User credentials for the remote Oracle AQ broker-->

	<bean id="bookingJmsFactoryUserCredentialsAdapter"
		class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">

		<property name="targetConnectionFactory" ref="bookingJmsFactory" />
		<property name="username" value="${jms.external.etlp.database.username}" />
		<property name="password" value="${jms.external.etlp.database.password}" />
	</bean>

	<!--
		Injection of oracle AQ connection factory plus credentials into a Jms
		Component
	-->
	<bean id="bookingJms" class="org.apache.camel.component.jms.JmsComponent">
		<property name="connectionFactory">

			<!-- Fix for Camel to handle XMLType payload queues -->
			<bean class="com.ee.lglbe.util.oracle.PayloadConnectionFactoryAdapter">
				<property name="targetConnectionFactory" ref="bookingJmsFactoryUserCredentialsAdapter"
/>
			</bean>
		</property>
	</bean>


2) I started my broker and initialised above bridge and verified that messages began to be
consumed

3) I disconnected the network between the local broker and the remote AQ broker (by switching
off my VPN!)

4) Waited 2 minutes and verified that nothing worked anymore

5) Reconnected the network and voila, the bridge remained active and new messages were consumed

Great job and thanks :)))

Andrew

> Need a facility to retry jms connections to a foreign provider by the ActiveMQ JMS bridge.
> ------------------------------------------------------------------------------------------
>
>                 Key: AMQ-2455
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2455
>             Project: ActiveMQ
>          Issue Type: New Feature
>          Components: Broker
>         Environment: Debian Lenny.  ActiveMQ 5.2.  OpenJMS-0.7.7-beta-1
>            Reporter: Billy Buzzard
>            Assignee: Rob Davies
>             Fix For: 5.4.0
>
>         Attachments: bridge-reconnect.patch, test.zip
>
>
> I followed an example (http://www.codeproject.com/KB/docview/jms_to_jms_bridge_activem.aspx?display=Print)
showing how to set up a bridge between OpenJMS and ActiveMQ.  The bridge seems to work perfectly
until I stop then restart OpenJMS while leaving ActiveMQ running.  Once I restart OpenJMS
I try sending a message from it to ActiveMQ, but ActiveMQ doesn't receive it until I stop
and restart ActiveMQ.  I can recreate the exact same problem by starting ActiveMQ first and
then OpenJMS.  After a little more reading it looks like failover should fix this problem,
but I tried it and it didn't work.  I submitted a question to ActiveMQ and Gary Tully responded
and told me there is currently no facility to retry jms connections to a foreign provider
by the ActiveMQ JMS bridge.
> Assuming that remote end-points may not be using ActiveMQ then I would think this would
be a very important feature to have.
> Here's a link to our conversation: http://www.nabble.com/How-to-configure-failover-for-jmsBridgeConnector-td25909047.html#a25918800
> The conversation also contains an attachment showing me configuration file.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message