On Feb 19, 2008 10:38 AM, wha <[EMAIL PROTECTED]> wrote:
>
> Well I don't know what to say, it doesn't work for me when I do
> advisorySupport="false"
>
> If you want to try it. Here's my BrokerA activemq.xml
>
>   <broker xmlns="http://activemq.org/config/1.0";
>         brokerName="brokerA"
>         dataDirectory="${activemq.base}/data"
>         useJmx="true"
>         advisorySupport="false">
>
>     <transportConnectors>
>        <transportConnector name="inFromProducer" uri="tcp://localhost:8881"
> />
>     </transportConnectors>
>
>     <networkConnectors>
>                 <networkConnector name="outToBrokerB"
> uri="static://(tcp://localhost:9991)" dynamicOnly="true" networkTTL="3">
>                 </networkConnector>
>         </networkConnectors>
>   </broker>
>
> Here's my BrokerB, activemq.xml
>
>   <broker xmlns="http://activemq.org/config/1.0";
>         brokerName="brokerB"
>         dataDirectory="${activemq.base}/data"
>         useJmx="true"
>         advisorySupport="true">
>
>     <transportConnectors>
>        <transportConnector name="inFromBrokerA" uri="tcp://localhost:9991"
> />
>     </transportConnectors>
>
>     <networkConnectors>
>     </networkConnectors>
>   </broker>
>
>
> Here's my consumer code:
>
>         public void run()
>         {
>                 //Create a connection
>                 Connection conn = null;
>                 String user = null;
>                 String passw = null;
>                 String brokerurl = "tcp://localhost:9991";
>                 try
>                 {
>                         ActiveMQConnectionFactory connFactory = new
> ActiveMQConnectionFactory(user,passw,brokerurl);
>                         conn = connFactory.createConnection();
>                         conn.start();
>
>                         session = conn.createSession(false, 
> Session.CLIENT_ACKNOWLEDGE);
>                         conn.setExceptionListener(this);
>
>                         Queue dest = session.createQueue("TEST.Q1");
>
>                         MessageConsumer msgConsumer = 
> session.createConsumer(dest);
>
>                         msgConsumer.setMessageListener(this);
>
>                         System.out.println("Listening Q1...");
>
>                 }
>                 catch (JMSException jmse)
>                 {
>                         System.out.println("JMSException in run() : " + jmse);
>                 }
>         }
>
>         public void onException(JMSException jmse)
>         {
>                 System.out.println(jmse);
>         }
>
>         public void onMessage(Message mess)
>         {
>                 try
>                 {
>                         //Thread.sleep(5 * 1000);
>
>                         DateFormat dateFormat = new 
> SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
>                         java.util.Date date = new java.util.Date();
>
>                         System.out.println(dateFormat.format(date) + " - 
> Received msg: " +
> ((TextMessage)mess).getText());
>                         mess.acknowledge();
>
>                 }
>                 catch (JMSException jmse)
>                 {
>                         System.out.println("JMSException in onMessage()" + 
> jmse);
>                 }
>         }
>
> And I didn't use any custom producer. I used the "Send To" from the Web
> Admin Queues page.
>
> When I turn the advisorySupport to "false" on BrokerB, Store and Forward
> stops working.
>
> Is this a bug ? Should I post a Jira ?

As Rob stated, a network of brokers requires that the advisory topics
be enabled, and it is enabled by default in the BrokerService object.
The only way to disable it is to do so explicitly via the
advisorySupport attribute on the broker element. In none of the
instructions I provided did I advise setting the advisorySupport
attribute to false.

Bruce
-- 
perl -e 'print unpack("u30","D0G)[EMAIL 
PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/

Reply via email to