Thank you for your answer, Sanne. But i am wondering:
1) Don't you find it strange that you have to set failOver to false? I find it a little bit odd. 2) If ever I do this it doesn't it mean that i need to restart all the brokers, in order for them to reconnect ones to the other?

Gabriel


sanne a écrit :
Hi Gabriel,

It worked for me when I set failOver=false on the connector.

Regards,

Sanne


gabriel kastenbaum wrote:
Hi,
I'm a newbie with ActiveMQ so my troubles may be due to a bad configuration.
Here's my problem :
There are 3 servers (IP=100.29.191.225, 100.29.191.226 and 100.29.191 .227) .
All the 3 servers are working on Linux (kernel=2.4).

Servers 1 and 2 sends messages  to server 3 through queues.
Server 3 sends messages to 1 and 2 through a topic.
Since multicast isn't available on my network, I've to use static addresses. ActiveMQ is integrated with JBoss. The integration includes both inbound and outbound messages. Inbound messages are handled by Message Driven Beans (MDBs) and outbound messages are published by an EJB Stateless Session Bean. I'm using a JRE 1.5_09

1) I used ActiveMQ 4.0.1 for my first tests.
*_activemq.xml file for server 1 was :_*
<beans xmlns="http://activemq.org/config/1.0";>
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
  <broker brokerName="${hostname}" useJmx="true">
<memoryManager> <usageManager id="memory-manager" limit="1048576"/>
    </memoryManager>
    <managementContext>
<managementContext connectorPort="1097" jmxDomainName="org.apache.activemq"/>
    </managementContext>
     <destinationPolicy>
      <policyMap><policyEntries>
<policyEntry topic="FOO.>">
            <dispatchPolicy>
              <strictOrderDispatchPolicy />
            </dispatchPolicy>
            <subscriptionRecoveryPolicy>
              <lastImageSubscriptionRecoveryPolicy />
            </subscriptionRecoveryPolicy>
          </policyEntry>
      </policyEntries></policyMap>
    </destinationPolicy>

    <persistenceAdapter>
<journaledJDBC useJournal="false" useQuickJournal="false" dataSource="#postgres-ds"/>
    </persistenceAdapter>
     <transportConnectors>
<transportConnector name="dossierspistes" uri="tcp://localhost:61611" brokerName="${hostname}"/>
    </transportConnectors>
    <networkConnectors>
<networkConnector name="dossierspistes" uri="static://(tcp://100.29.191.227:61611)" failover="true" networkTTL="255" brokerName="${hostname}"/> </networkConnectors> </broker> <bean id="postgres-ds" class="org.postgresql.ds.PGPoolingDataSource">
    <property name="serverName" value="127.0.0.1"/>
    <property name="databaseName" value="activemq"/>
    <property name="portNumber" value="0"/>
    <property name="user" value="postgres"/>
    <property name="password" value=""/>
    <property name="dataSourceName" value="postgres"/>
    <property name="initialConnections" value="2"/>
    <property name="maxConnections" value="10"/>
  </bean>
</beans>
*_file for server 2 :_*
(...)
<networkConnector name="dossierspistes" uri="static://(tcp://100.29.191.227:61611)" failover="true" networkTTL="255" brokerName="${hostname}"/>
(...)
*_file for server 3 :_*
(...)
<networkConnector name="dossierspistes" uri="static://(tcp://100.29.191.225:61611,tcp://100.29.191.226:61611)" failover="true" networkTTL="255" brokerName="${hostname}"/>
(...) *__*
*_META-INF/ra.xml (on the 3 servers) :_*
<config-property-value>tcp://localhost:61611</config-property-value> *__*
*_No broker-config.xml_*
*__*


If the servers are on line during all the operations, everything goes well : messages are published and received by all.
The problems came when I disconnected Server 1.
a) Server 3 published a message on its topic : server 2 received it. But when server 1 came back online, it did *not* get the message. b) Server 1 sent a message on its queue and then came back online : Server 3 did not receive it. 2) Thinking it may be due to http://issues.apache.org/activemq/browse/AMQ-895, <http://issues.apache.org/activemq/browse/AMQ-895>I've used the patch for ActiveMQ 4.0.2 with the same configuration files but the problem still remains. 3) My third tests was with ActiveMQ 4.1. The configuration was quite the same :
*_activemq.xml, Server 1 :
_*(...)
    <transportConnectors>
<transportConnector name="dossierspistes-tp" uri="tcp://localhost:61616" brokerName="${hostname}"/>
    </transportConnectors>
<networkConnectors> <networkConnector name="dossierspistes-nc" uri="static://(tcp://100.29.191.227:61616)" failover="true" networkTTL="255" brokerName="${hostname}"/> </networkConnectors> (...) *_Server 2 :_*
(...)
<networkConnector name="dossierspistes-nc" uri="static://(tcp://100.29.191.227:61616)" failover="true" networkTTL="255" brokerName="${hostname}"/>
 (...)
*_Server 3 :_*
(...)
<networkConnector name="dossierspistes-nc" uri="static://(tcp://100.29.191.225:61616,tcp://100.29.191.226:61616)" failover="true" networkTTL="255" brokerName="${hostname}"/>
(...)
*__*
All servers stayed online during the test. No disconnection
Server 3 published a message on its topic.
            Server 2 received it.
Server 1 sometimes receives the messages, but does not receive messages at all. Am I missing something ?




Reply via email to