You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by flachwassertiroler <ma...@desy.de> on 2008/03/17 19:47:00 UTC

messages don't find their way to consumer

Hi all,

I'm a total newbie to ActiveMQ and JMS in general, so here's my question:

I have a topic publisher and a subscriber. Each of them connects to an
embedded broker, those brokers connect to a central, standalone broker
(using duplex connections), spanning a network of brokers.

I see in the debug of the central broker ("broker1")', that both "leaf"
broker connect and duplex is enabled. Subscriber and Publisher use the same
topic. Unfortunately, the subscriber never gets a single message!

What I observe: When the broker of the subscriber ("LeafBrokerSubscriber")
connects, the central broker receives the consumer request:

Broker1 Forwarding sub on vm://Broker1#28 from LeafBrokerSubscriber : 
ConsumerInfo {commandId = 4, responseRequired = true, consumerId =
ID:pcx5211-36658-1205777953152-3:0:1:1, destination =
topic://ActiveMQNewsChannel, prefetchSize = 32766,
maximumPendingMessageLimit = 0, browser = false, dispatchAsync = false,
selector = null, subscriptionName = null, noLocal = false, exclusive =
false, retroactive = false, priority = 0, brokerPath = null,
optimizedAcknowledge = false, noRangeAcks = false, additionalPredicate =
null}

The publisher also connects to the central broker (via it's embedded
"LeafBrokerPublisher") and sends messages. They are not forwarded to the
consumer, but pile up on the LeafBrokerPublisher (observed with JMX). I also
see through JMX that all 3 brokers have my topic ("ActiveMQNewsChannel").

What am I doing wrong? Please find attached the code snippet of the embedded
broker, the xml conf of the central broker and debug output of the
Publishing client, the subscribing client and the central broker.

Thanks in advance, I'm already a bit desperate!!

Cheers,
Martin

http://www.nabble.com/file/p16098486/emebddedBrokerSnippet
emebddedBrokerSnippet 
http://www.nabble.com/file/p16098486/broker1Config.xml broker1Config.xml 
http://www.nabble.com/file/p16098486/centralBrokerDebug centralBrokerDebug 
http://www.nabble.com/file/p16098486/PublisherDebug PublisherDebug 
http://www.nabble.com/file/p16098486/SubscriberDebug SubscriberDebug 

-- 
View this message in context: http://www.nabble.com/messages-don%27t-find-their-way-to-consumer-tp16098486s2354p16098486.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: messages don't find their way to consumer

Posted by flachwassertiroler <ma...@desy.de>.
Hi James,

thanks for the reply.

Yes, it works if both clients connect to a standalone broker. It even works
if I have 2 standalone-brokers (store-and-forward interconnect), each of
them connected with a client.

So I guess the conf of my embedded broker (programatically configured) is
incorrect. Here again the java snippet, which configures the broker:

-------------------------------------------------------------------------------

       _broker = new BrokerService();
        _broker.setBrokerName(_brokerName);
        //broker.setUseShutdownHook(true);
        
        _broker.setUseJmx(true);
        _broker.setPersistent(false);
        _broker.setClustered(true);
                
        NetworkConnector connector = new
DiscoveryNetworkConnector(_upstreamBrokerURI);
        
        connector.setDuplex(true);
        connector.setNetworkTTL(30);
        connector.setBridgeTempDestinations(true);
        connector.setDynamicOnly(true);
        
        _broker.addNetworkConnector(connector);

        _broker.start();

-------------------------------------------------------------------------------

I need to configure the broker this way (and not via XML), because I don't
know the brokerName at startup-time and loading the broker-config from xml
(xbean) and overwriting the brokername doesn't seem to work.

BTW, I use ActiveMQ 5.0.0 with SUN JDK 1.6

Any help is highly appreciated..

Cheers,
Martin






James.Strachan wrote:
> 
> Does your application work when using a single broker without using
> store & forward networking?
> 
> On 17/03/2008, flachwassertiroler <ma...@desy.de> wrote:
>>
>>  Hi all,
>>
>>  I'm a total newbie to ActiveMQ and JMS in general, so here's my
>> question:
>>
>>  I have a topic publisher and a subscriber. Each of them connects to an
>>  embedded broker, those brokers connect to a central, standalone broker
>>  (using duplex connections), spanning a network of brokers.
>>
>>  I see in the debug of the central broker ("broker1")', that both "leaf"
>>  broker connect and duplex is enabled. Subscriber and Publisher use the
>> same
>>  topic. Unfortunately, the subscriber never gets a single message!
>>
>>  What I observe: When the broker of the subscriber
>> ("LeafBrokerSubscriber")
>>  connects, the central broker receives the consumer request:
>>
>>  Broker1 Forwarding sub on vm://Broker1#28 from LeafBrokerSubscriber :
>>  ConsumerInfo {commandId = 4, responseRequired = true, consumerId =
>>  ID:pcx5211-36658-1205777953152-3:0:1:1, destination =
>>  topic://ActiveMQNewsChannel, prefetchSize = 32766,
>>  maximumPendingMessageLimit = 0, browser = false, dispatchAsync = false,
>>  selector = null, subscriptionName = null, noLocal = false, exclusive =
>>  false, retroactive = false, priority = 0, brokerPath = null,
>>  optimizedAcknowledge = false, noRangeAcks = false, additionalPredicate =
>>  null}
>>
>>  The publisher also connects to the central broker (via it's embedded
>>  "LeafBrokerPublisher") and sends messages. They are not forwarded to the
>>  consumer, but pile up on the LeafBrokerPublisher (observed with JMX). I
>> also
>>  see through JMX that all 3 brokers have my topic
>> ("ActiveMQNewsChannel").
>>
>>  What am I doing wrong? Please find attached the code snippet of the
>> embedded
>>  broker, the xml conf of the central broker and debug output of the
>>  Publishing client, the subscribing client and the central broker.
>>
>>  Thanks in advance, I'm already a bit desperate!!
>>
>>  Cheers,
>>  Martin
>>
>>  http://www.nabble.com/file/p16098486/emebddedBrokerSnippet
>>  emebddedBrokerSnippet
>>  http://www.nabble.com/file/p16098486/broker1Config.xml broker1Config.xml
>>  http://www.nabble.com/file/p16098486/centralBrokerDebug
>> centralBrokerDebug
>>  http://www.nabble.com/file/p16098486/PublisherDebug PublisherDebug
>>  http://www.nabble.com/file/p16098486/SubscriberDebug SubscriberDebug
>>
>>
>>  --
>>  View this message in context:
>> http://www.nabble.com/messages-don%27t-find-their-way-to-consumer-tp16098486s2354p16098486.html
>>  Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/messages-don%27t-find-their-way-to-consumer-tp16098486s2354p16116556.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: messages don't find their way to consumer

Posted by James Strachan <ja...@gmail.com>.
Does your application work when using a single broker without using
store & forward networking?

On 17/03/2008, flachwassertiroler <ma...@desy.de> wrote:
>
>  Hi all,
>
>  I'm a total newbie to ActiveMQ and JMS in general, so here's my question:
>
>  I have a topic publisher and a subscriber. Each of them connects to an
>  embedded broker, those brokers connect to a central, standalone broker
>  (using duplex connections), spanning a network of brokers.
>
>  I see in the debug of the central broker ("broker1")', that both "leaf"
>  broker connect and duplex is enabled. Subscriber and Publisher use the same
>  topic. Unfortunately, the subscriber never gets a single message!
>
>  What I observe: When the broker of the subscriber ("LeafBrokerSubscriber")
>  connects, the central broker receives the consumer request:
>
>  Broker1 Forwarding sub on vm://Broker1#28 from LeafBrokerSubscriber :
>  ConsumerInfo {commandId = 4, responseRequired = true, consumerId =
>  ID:pcx5211-36658-1205777953152-3:0:1:1, destination =
>  topic://ActiveMQNewsChannel, prefetchSize = 32766,
>  maximumPendingMessageLimit = 0, browser = false, dispatchAsync = false,
>  selector = null, subscriptionName = null, noLocal = false, exclusive =
>  false, retroactive = false, priority = 0, brokerPath = null,
>  optimizedAcknowledge = false, noRangeAcks = false, additionalPredicate =
>  null}
>
>  The publisher also connects to the central broker (via it's embedded
>  "LeafBrokerPublisher") and sends messages. They are not forwarded to the
>  consumer, but pile up on the LeafBrokerPublisher (observed with JMX). I also
>  see through JMX that all 3 brokers have my topic ("ActiveMQNewsChannel").
>
>  What am I doing wrong? Please find attached the code snippet of the embedded
>  broker, the xml conf of the central broker and debug output of the
>  Publishing client, the subscribing client and the central broker.
>
>  Thanks in advance, I'm already a bit desperate!!
>
>  Cheers,
>  Martin
>
>  http://www.nabble.com/file/p16098486/emebddedBrokerSnippet
>  emebddedBrokerSnippet
>  http://www.nabble.com/file/p16098486/broker1Config.xml broker1Config.xml
>  http://www.nabble.com/file/p16098486/centralBrokerDebug centralBrokerDebug
>  http://www.nabble.com/file/p16098486/PublisherDebug PublisherDebug
>  http://www.nabble.com/file/p16098486/SubscriberDebug SubscriberDebug
>
>
>  --
>  View this message in context: http://www.nabble.com/messages-don%27t-find-their-way-to-consumer-tp16098486s2354p16098486.html
>  Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com