You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Vinod Venkatraman <vi...@yahoo.com> on 2007/10/22 15:40:18 UTC

Store and forward brokers issue

Hi,

Am using apache-activemq-5.0-20071015.164042-22.zip

I have couple of standalone store and forward brokers running. With
configuration as shown below. Producers/Consumers/Brokers are using
multicast discovery.

Following is the problem i am facing:
When producer and consumer happen to discover and connect to the same broker
(say B1) even then many messages are getting forwarded to B2. And since
there are no consumers on B2 they remain there and are never consumed. 

Meanwhile the consumer connected to B1 receives no/very few messages.

I verified this by making a 2nd consumer connect directly to B2 and then it
consumes all the forwarded messages.

What I was expecting is that messages would never be forwarded to B2 as it
does not have any registered consumers.

When producer and consumer happen to discover and connect to different
brokers things work fine and all messages are consumed. 

Any help would be appreciated.

<beans>

  <!-- Allows us to use system properties as variables in this configuration
file -->
  <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>

    <broker brokerName="broker_vinod" useJmx="true"
xmlns="http://activemq.org/config/1.0">
    <persistenceAdapter>
        <journaledJDBC journalLogFiles="5"
dataDirectory="${activemq.base}/activemq-data/broker1_slave"/>
    </persistenceAdapter>

    <transportConnectors>
       <transportConnector name="openwire" uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
    </transportConnectors>

    <networkConnectors>
      <!-- by default just auto discover the other brokers -->
      <networkConnector name="default-nc" uri="multicast://default"/>
    </networkConnectors>

  </broker>



Thanks,
Vinod
-- 
View this message in context: http://www.nabble.com/Store-and-forward-brokers-issue-tf4670537s2354.html#a13342280
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Store and forward brokers issue

Posted by ttmdev <jo...@ttmsolutions.com>.
Vinod,

Try setting the network connector attribute called 'dynamicOnly' to true as
follows. 

<networkConnector name="default-nc" dynamicOnly="true"
uri="multicast://default"/> 

This will instruct the broker to forward messages only if there are active
consumers at the connected broker. By default, dynamicOnly is set to false. 

Joe
 


Vinod Venkatraman wrote:
> 
> Hi,
> 
> Am using apache-activemq-5.0-20071015.164042-22.zip
> 
> I have couple of standalone store and forward brokers running. With
> configuration as shown below. Producers/Consumers/Brokers are using
> multicast discovery.
> 
> Following is the problem i am facing:
> When producer and consumer happen to discover and connect to the same
> broker (say B1) even then many messages are getting forwarded to B2. And
> since there are no consumers on B2 they remain there and are never
> consumed. 
> 
> Meanwhile the consumer connected to B1 receives no/very few messages.
> 
> I verified this by making a 2nd consumer connect directly to B2 and then
> it consumes all the forwarded messages.
> 
> What I was expecting is that messages would never be forwarded to B2 as it
> does not have any registered consumers.
> 
> When producer and consumer happen to discover and connect to different
> brokers things work fine and all messages are consumed. 
> 
> Any help would be appreciated.
> 
> <beans>
> 
>   <!-- Allows us to use system properties as variables in this
> configuration file -->
>   <bean
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
> 
>     <broker brokerName="broker_vinod" useJmx="true"
> xmlns="http://activemq.org/config/1.0">
>     <persistenceAdapter>
>         <journaledJDBC journalLogFiles="5"
> dataDirectory="${activemq.base}/activemq-data/broker1_slave"/>
>     </persistenceAdapter>
> 
>     <transportConnectors>
>        <transportConnector name="openwire" uri="tcp://localhost:61616"
> discoveryUri="multicast://default"/>
>     </transportConnectors>
> 
>     <networkConnectors>
>       <!-- by default just auto discover the other brokers -->
>       <networkConnector name="default-nc" uri="multicast://default"/>
>     </networkConnectors>
> 
>   </broker>
> 
> 
> 
> Thanks,
> Vinod
> 

-- 
View this message in context: http://www.nabble.com/Store-and-forward-brokers-issue-tf4670537s2354.html#a13364379
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Store and forward brokers issue

Posted by navneek <na...@gmail.com>.
Hi,

To achieve your expectation. you need to make additional configuration under 
tag..
make the following configuration... it'll work..

1. If you want to forward particular queue or exclude particular Q from
forwarding, or want to strictly forward a Q to next broker..whatever......
then add following accordingly

    
      
      
        
      		
      		
      	
      	
      		
      		
      	
        
      		
      		
      	

                 
    

2. If u want to forward only when a active consumer at target broker..then
add the following..

     dynamicOnly = "true" under network connector..


Hope it will help u..

-Navneeth.




Vinod Venkatraman wrote:
> 
> Hi,
> 
> Am using apache-activemq-5.0-20071015.164042-22.zip
> 
> I have couple of standalone store and forward brokers running. With
> configuration as shown below. Producers/Consumers/Brokers are using
> multicast discovery.
> 
> Following is the problem i am facing:
> When producer and consumer happen to discover and connect to the same
> broker (say B1) even then many messages are getting forwarded to B2. And
> since there are no consumers on B2 they remain there and are never
> consumed. 
> 
> Meanwhile the consumer connected to B1 receives no/very few messages.
> 
> I verified this by making a 2nd consumer connect directly to B2 and then
> it consumes all the forwarded messages.
> 
> What I was expecting is that messages would never be forwarded to B2 as it
> does not have any registered consumers.
> 
> When producer and consumer happen to discover and connect to different
> brokers things work fine and all messages are consumed. 
> 
> Any help would be appreciated.
> 
> 
> 
>   
>   
> 
>     
>     
>         
>     
> 
>     
>        
>     
> 
>     
>       
>       
>     
> 
>   
> 
> 
> 
> Thanks,
> Vinod
> 

-- 
View this message in context: http://www.nabble.com/Store-and-forward-brokers-issue-tf4670537s2354.html#a13396318
Sent from the ActiveMQ - User mailing list archive at Nabble.com.