Hi torsten, in-line comments. On Mon, Aug 13, 2012 at 12:33 AM, Torsten Mielke-2 [via ActiveMQ] < ml-node+s2283324n4655036...@n4.nabble.com> wrote:
> Hello, > > 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? > What would be the implications of a more complex topology? I don't want messages production calls to block, I read I could use timeouts but if my call to place a message on the stand alone broker times out I have to handle the case which complicates my code. If the message gets queued up locally by the embedded broker my code becomes much simpler. I also read in the AMQ documentation about the existence of some buffering mechanism so messages are placed in a local buffer if the stand alone broker is down but that mechanism is not persistent and I read comments where embedded broker was the reliable way to implement this functionality. > > > > > 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&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. > I actually ran this test already successfully with embedded brokers on the producer side and direct connections to the stand alone broker on the consumer side. > > > > > 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. > http://activemq.apache.org/advisory-message.html > > > > > I'm running 5.6.0 on brokers and clients with Java 1.6.0.14 on Linux, > > embedded and stand alone brokers are persistent. > > > > Any ideas of what I am missing? > > > > > Hope this helps a bit. > > > Torsten Mielke > [hidden email] <http://user/SendEmail.jtp?type=node&node=4655036&i=0> > [hidden email] <http://user/SendEmail.jtp?type=node&node=4655036&i=1> > > > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://activemq.2283324.n4.nabble.com/Store-and-Forward-with-embedded-brokers-stand-alone-broker-tp4655028p4655036.html > To unsubscribe from Store and Forward with embedded brokers + stand alone > broker, click > here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4655028&code=Y2xhdWRpby5zYW50YW5hQGdtYWlsLmNvbXw0NjU1MDI4fC0xNTA0MDM5ODky> > . > NAML<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > I won't be able to run this test for a few days. I'll let you know the results. Thanks for the quick and detailed response! Claudio -- View this message in context: http://activemq.2283324.n4.nabble.com/Store-and-Forward-with-embedded-brokers-stand-alone-broker-tp4655028p4655076.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.