activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Mielke <>
Subject Re: Store and Forward with embedded brokers + stand alone broker
Date Mon, 13 Aug 2012 07:32:52 GMT

Some answers in-line.

On Aug 11, 2012, at 4:20 AM, pollotek wrote:

> I have this web application that currently connects to a stand alone broker
> to place messages and consumer only nodes pick up and process the messages.
> I want to move this to have embedded brokers on each web app and each
> consumer and those embedded brokers should forward their messages to a stand
> alone broker that will sit in the middle just like it does today.
> producer app server -> embedded broker -> stand alone broker -> embedded
> broker -> consumer app server
> This will allow messages to be produced and queued up locally without
> blocking and have the messages forwarded asynchronously.

True but at the expense of a more complex topology. If you have a higher number of producers
and consumer, you will end up with a fairly huge hub-and-spoke broker network topology. Do
you really expect your JMS clients to be disconnected from the standalone broker that often
that you want to additionally run with embedded brokers? 

> As I understand the
> only thing to do here is to declare the embedded brokers on both app servers
> and point their network connectors to the stand alone broker. Messages are
> supposed to be stored in the embedded broker and if there are subscribers to
> the queue on the stand alone broker side messages will be forwarded.

Correct. However the network connector from your consumers embedded broker to the standalone
broker needs to be duplex, as otherwise msgs can only from from that embedded broker to the
standalone broker. 

> So I configured my embedded brokers with these parameters (this is the same
> configuration on both, consumers and producers) :
>        <amq:transportConnectors>
>            <amq:transportConnector uri="vm://localhost?async=true" />
>        </amq:transportConnectors>
>        <amq:networkConnectors>
>            <amq:networkConnector
> name="connection_to_nob-${activemq.brokerid}"
> uri="static:failover:(tcp://broker01:61616,tcp://broker02:61616)?randomize=false&amp;maxReconnectAttempts=0"/>
>        </amq:networkConnectors>

Add duplex=true to the network connectors of your consumer embedded brokers as mentioned above.

> The stand alone broker of course is configured to receive connections on
> 61616. I start up my application and make sure with JMX all consumers and
> producers are connected to the same broker (Master-slave shared file system)
> and everything looks ok so far. I create some messages for queues I have
> consumers for declared in the consumer side only.

To get up and running and eliminate possible errors, perhaps try without master/slave first.

> I point my producer and consumer app servers to connect to vm://localhost. I
> never see a single message leave the embedded broker on the producers side.
> I can see with JMX the stand alone broker doesn't create the queues where my
> process is placing new messages. 

Could be done to the fact that some of your network connectors needs to be duplex. 
For testing try to connect with a consumer to the standalone broker first and see if msgs
get passed from the producer's embedded broker to the standalone broker and to your directly
connected consumer. 
If they do, then your producer side configuration is correct. Then check the consumers config.

> As I understand from what I read I don't need to specifically create the
> queues to get messages forwarded to in the stand alone broker, they're
> supposed to be automatically created.

Correct, destinations get created automatically by the brokers once a producer or consumer
is connected. 

> I don't have anything special on my
> stand alone broker other than this destination Policy which I also have on
> the embedded brokers:
> <destinationPolicy>
>            <policyMap>
>                <policyEntries>
>                    <policyEntry queue=">">
>                        <deadLetterStrategy>
>                            <individualDeadLetterStrategy queuePrefix="DLQ."
> useQueueForQueueMessages="true" />
>                        </deadLetterStrategy>
>                    </policyEntry>
>                </policyEntries>
>            </policyMap>
>        </destinationPolicy>

That config is fine and would not cause your problem. 
See my above points and also verify that you did not disable support for advisory messages
explicitly in your broker configurations. These are needed in a broker network to share information
about connected JMS clients.

> I'm running 5.6.0 on brokers and clients with Java on Linux,
> embedded and stand alone brokers are persistent.
> Any ideas of what I am missing?

Hope this helps a bit.

Torsten Mielke

View raw message