You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by vilvic <jo...@vilvic.com> on 2011/11/15 11:49:37 UTC

Connection to a remote active mq broker

Hi,

I'm using Glassfish 3.1, ActiveMQ 5.5.1, GenericRA 2.1, spring 3

I have configured active mq and tested to work locally and now it's time
to test connecting to a remote active mq broker.

I cannot seem to get this working.  This is my resource adapter configs in
glassfish.

./asadmin create-resource-adapter-config --threadpoolid thread-pool-1
--property
SupportsXA=true:RMPolicy=OnePerPhysicalConnection:ProviderIntegrationMode=javabean:ConnectionFactoryClassName=org.apache.activemq.ActiveMQConnectionFactory:QueueConnectionFactoryClassName=org.apache.activemq.ActiveMQConnectionFactory:TopicConnectionFactoryClassName=org.apache.activemq.ActiveMQConnectionFactory:XAConnectionFactoryClassName=org.apache.activemq.ActiveMQXAConnectionFactory:XAQueueConnectionFactoryClassName=org.apache.activemq.ActiveMQXAConnectionFactory:XATopicConnectionFactoryClassName=org.apache.activemq.ActiveMQXAConnectionFactory:UnifiedDestinationClassName=org.apache.activemq.command.ActiveMQDestination:QueueClassName=org.apache.activemq.command.ActiveMQQueue:TopicClassName=org.apache.activemq.command.ActiveMQTopic:ConnectionFactoryProperties=brokerURL\\=tcp\\://x.x.x.x\\:61616:LogLevel=FINE
genericRA

I've looked in the active mq admin tool and there are no active consumers.

It appears as though this setting is being ignored;

ConnectionFactoryProperties=brokerURL\\=tcp\\://x.x.x.x\\:61616

Even with this setting if I fire up a local active mq broker it works and
it starts to use the local broker.

--
View this message in context: http://activemq.2283324.n4.nabble.com/Connection-to-a-remote-active-mq-broker-tp4042508p4042508.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Connection to a remote active mq broker

Posted by vilvic <jo...@vilvic.com>.
Just to add to my previous post.  I waited 5 minutes while the app was
hanging.  I fired up the local active mq broker and within a few seconds the
app stopped hanging and continued on.  I can't tell if the
ConnectionFactoryProperties setting is being ignored but it seems telling to
me that once the local active mq broker is running that it continues.  Since
I have no failover  configured why would it use the local amq broker?

Looking at the source (and with some guesswork) I assume the
ActiveMQXAConnectionFactory in instantiated using the default constructor,
thereby setting brokerURL to the value of DEFAULT_BROKER_URL.  It appears
that when the first message is put onto the queue that the connection is
established. I further assumed that setProperties(Properties props) (from
JNDIBaseSortable which ActiveMQXAConnectionFactory extends) is called, which
in turn calls buildFromProperties(props) which should then set the brokerURL
to my setting.

It's my belief that setProperties(Properties props) is not being called.

--
View this message in context: http://activemq.2283324.n4.nabble.com/Connection-to-a-remote-active-mq-broker-tp4042508p4073152.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Connection to a remote active mq broker

Posted by vilvic <jo...@vilvic.com>.
I've just tried that with the same effect as before.

When it hits the code to post the message onto the queue it hangs.  I've
tried to telnet to that address and port and I get a response from the
broker so I know there are no firewall issues.

--
View this message in context: http://activemq.2283324.n4.nabble.com/Connection-to-a-remote-active-mq-broker-tp4042508p4060513.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Connection to a remote active mq broker

Posted by Gary Tully <ga...@gmail.com>.
should that property be: serverURL in place of brokerURL? try that.

On 15 November 2011 10:49, vilvic <jo...@vilvic.com> wrote:
> Hi,
>
> I'm using Glassfish 3.1, ActiveMQ 5.5.1, GenericRA 2.1, spring 3
>
> I have configured active mq and tested to work locally and now it's time
> to test connecting to a remote active mq broker.
>
> I cannot seem to get this working.  This is my resource adapter configs in
> glassfish.
>
> ./asadmin create-resource-adapter-config --threadpoolid thread-pool-1
> --property
> SupportsXA=true:RMPolicy=OnePerPhysicalConnection:ProviderIntegrationMode=javabean:ConnectionFactoryClassName=org.apache.activemq.ActiveMQConnectionFactory:QueueConnectionFactoryClassName=org.apache.activemq.ActiveMQConnectionFactory:TopicConnectionFactoryClassName=org.apache.activemq.ActiveMQConnectionFactory:XAConnectionFactoryClassName=org.apache.activemq.ActiveMQXAConnectionFactory:XAQueueConnectionFactoryClassName=org.apache.activemq.ActiveMQXAConnectionFactory:XATopicConnectionFactoryClassName=org.apache.activemq.ActiveMQXAConnectionFactory:UnifiedDestinationClassName=org.apache.activemq.command.ActiveMQDestination:QueueClassName=org.apache.activemq.command.ActiveMQQueue:TopicClassName=org.apache.activemq.command.ActiveMQTopic:ConnectionFactoryProperties=brokerURL\\=tcp\\://x.x.x.x\\:61616:LogLevel=FINE
> genericRA
>
> I've looked in the active mq admin tool and there are no active consumers.
>
> It appears as though this setting is being ignored;
>
> ConnectionFactoryProperties=brokerURL\\=tcp\\://x.x.x.x\\:61616
>
> Even with this setting if I fire up a local active mq broker it works and
> it starts to use the local broker.
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Connection-to-a-remote-active-mq-broker-tp4042508p4042508.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
http://fusesource.com
http://blog.garytully.com