activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dknig1b <daniel_knigh...@yahoo.com>
Subject queue connecting to wrong broker.
Date Fri, 04 Apr 2008 18:59:42 GMT

I have a set up where I have 3 servers and 2 brokers:

Server A: running an embedded broker (BrokerA) on localhost:61616
                providing a message Queue called QueueOne

Server B: subscribes to QueueOne on localhost:61616
               has an embedded broker (BrokerB) producing a topic TopicOne
on localhost 61617

Server C: subscribes to topic T1.


As I have things set up, when I start server B, the queue connects to the
broker on Server even though I'm
telling it to connect to localhost:61617.

Without the broker on Server B, the queue subscriber on Server B connects to
the broker on Server A, however the minute I include the broker on Server B,
and restart, the Queue connects to brokerB instead of BrokerA.

I'm confused about where I'm going wrong.  I am embedding activemq 4.1.1
ontop of Tomcat 5.5.9. 
My configurations are listed below:

Server A:  Context.xml setting up JNDI:
          <Resource name="jms/ConnectionFactory" auth="Container"
type="org.apache.activemq.ActiveMQConnectionFactory" description="JMS
Connection Factory" factory="org.apache.activemq.jndi.JNDIReferenceFactory"
brokerURL="vm://localhost" brokerName="ActiveMQBroker"/>

          <Resource name="jms/QueueOne" auth="Container"
type="org.apache.activemq.command.ActiveMQQueue" description="Queue One"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
physicalName="QueueOne"/>

ServerA activemq.xml:
<beans>
  <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
  <broker useJmx="false"  xmlns="http://activemq.org/config/1.0"
persistent="false">
    <transportConnectors>
      <transportConnector uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
    </transportConnectors>
    <networkConnectors>
      <networkConnector uri="multicast://default"/>
    </networkConnectors>
  </broker>
</beans>

Server B: Context.xml to setup JNDI:

<Resource name="jms/QueueConnectionFactory" auth="Container"
type="org.apache.activemq.ActiveMQConnectionFactory" description="JMS
Connection Factory" factory="org.apache.activemq.jndi.JNDIReferenceFactory"
brokerURL="tcp://127.0.0.1:61616" brokerName="ActiveMQBroker"
useEmbeddedBroker="false"/>

<Resource name="jms/messageQueueOne" auth="Container"
type="org.apache.activemq.command.ActiveMQQueue" description="CMC VDS Queue"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
physicalName="QueueOne"/>

         <Resource name="jms/ConnectionFactory" auth="Container"
type="org.apache.activemq.ActiveMQConnectionFactory" description="JMS
Connection Factory" factory="org.apache.activemq.jndi.JNDIReferenceFactory"
brokerURL="tcp://127.0.0.1:61617" useEmbeddedBroker="true"
brokerName="TopicProviderActiveMQBroker"/>

          <Resource name="jms/FeedNotificationTopic" auth="Container"
type="org.apache.activemq.command.ActiveMQTopic" description="Topic to
notify when a feed successfully executes."
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
physicalName="TopicOne"/>

ServerB: activemq.xml:

<beans>
  <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
  <broker useJmx="false"  xmlns="http://activemq.org/config/1.0"
persistent="false">
    <transportConnectors>
      <transportConnector uri="tcp://localhost:61617" />
    </transportConnectors>
    <destinations>
      <topic physicalName="TopicOne" />
    </destinations>
  </broker>
</beans>

With this configuration when I start ServerB and tail the activemq logs, I
can see that BrokerB is creating a new destination for QueueOne
DEBUG|2008-04-04 10:20:13,970 ActiveMQ Transport:
tcp:///localhost:41048|org.apache.activemq.broker.region.AbstractRegion|||Adding
destination: queue://QueueOne

which apparently the queue client subscribes to, instead of the queue on
BrokerA.

How can I prevent this?

Thanks.
-- 
View this message in context: http://www.nabble.com/queue-connecting-to-wrong-broker.-tp16494451s2354p16494451.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message