That's expected behavior.  By default, brokers only forward messages when
there's a currently-connected consumer somewhere in the network.  If
there's no consumer, the message will hang out on the producing broker,
waiting for the consumer to connect.  When it does connect, the broker that
holds the message will find out about the consumer and forward the message
towards the broker it's connected on.

This makes sense when you think about a more-complicated network of brokers
where a consumer could reconnect to any broker, not just the one it last
connected to; if you forward the message to the last broker the
consumer was on, you might find that it's reconnected to a different broker
somewhere else (maybe even the one the producer is on!), and now you've got
to forward the messages a second time, resulting in wasted network traffic.

On Wed, Nov 12, 2014 at 2:02 PM, juanmanuel.romeraferrio <
juanmanuel.romerafer...@gmail.com> wrote:

> Hi, I'm having a problem in my system.
>
> In my producer, I have the next configuration.
>
>
>         <bean id="kahaDBPersistenceAdapter"
>
> class="org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter">
>                 <property name="checksumJournalFiles" value="true" />
>                 <property name="checkForCorruptJournalFiles" value="true"
> />
>                 <property name="ignoreMissingJournalfiles" value="true" />
>                 <property name="directory" value="../data/KahaDB/" />
>         </bean>
>
>
>         <bean id="bridgedBroker"
> class="org.apache.activemq.broker.BrokerService"
>                 init-method="start" destroy-method="stop" >
>                 <property name="brokerName" value="#{gemfireProps.name}" />
>                 <property name="persistent" value="true" />
>                 <property name="transportConnectorURIs"
> value="vm://localhost:61617" />
>                 <property name="networkConnectors">
>                         <list>
>                                 <bean
> class="org.apache.activemq.network.DiscoveryNetworkConnector">
>                                         <property name="uri"
> value="static:failover:(tcp://queue1-r35-01.desa.emp.com:61616,tcp://
> queue1-r35-02.desa.emp.com:61616)"
> />
>                                 </bean>
>                         </list>
>                 </property>
>                 <property name="persistenceAdapter"
> ref="kahaDBPersistenceAdapter" />
>         </bean>
>
>
>         <bean id="amqConnectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>                 <property name="brokerURL" value="vm://localhost:61617" />
>         </bean>
>
>
>         <bean id="connectionFactory"
>
> class="org.springframework.jms.connection.CachingConnectionFactory">
>                 <property name="targetConnectionFactory"
> ref="amqConnectionFactory" />
>         </bean>
>
>
>
> And the problem that I found is that if my consumer is not running, when I
> send a message to the remoteBroker this message is showed in the Apache
> ActiveMQ Console of the remoteBroker, but when I start the consumer the
> message appear and is consumed.
>
> Why this occur? The message is storage in my localBroker and is not sended
> if the consumer is not running?
>
> Thanks,
> Juan Manuel
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Problem-with-embedded-broker-tp4687370.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Reply via email to