activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Bain <tb...@alumni.duke.edu>
Subject Re: Can I make createQueue on embedded broker session create a queue on the remote broker as well?
Date Sat, 20 Jun 2015 04:55:04 GMT
I believe (but I've not tried to verify this) that the network connectors
should be used for bridging to another ActiveMQ broker (because they will
use the OpenWire protocol and be more efficient) whereas the JMS to JMS
connection should be used when the other broker is a non-ActiveMQ JMS
broker.

The differences you'll see when using dynamically included destinations are
basically what you've noted: 1) you don't have to know the names in advance
(wildcard matching is available, though somewhat limited), 2) messages will
be forwarded only when a consumer exists (because the disconnection of the
last consumer results in that destination no longer being bridged, until
another consumer connects), and 3) you have to enable advisory messages,
since that's what allows the dynamic nature of the forwarding.

Tim

On Thu, Jun 18, 2015 at 10:21 PM, pubudu gunawardena <pubudupg@gmail.com>
wrote:

> Thanks for the information Tim. I tried 'dynamic networks' setup and
> the queues are getting created. One thing that I would like to know
> is, when should the JMS to JMS connection be used and when should the
> Network connection be used? Is there any other difference when using
> the dynamic network setup (other than messages not being sent until a
> consumer is available)?
>
> On Thu, Jun 18, 2015 at 6:29 PM, Tim Bain <tbain@alumni.duke.edu> wrote:
> > Have you set up your dynamically included destinations as described by
> the
> > "dynamic networks" section of
> > http://activemq.apache.org/networks-of-brokers.html?
> >
> > Note that under that setup, messages will be forwarded to the standalone
> > remote broker only if there is a currently-attached consumer on the
> remote
> > broker; if there is no consumer, messages will stay on whichever broker
> > they were first sent to.  If that's not acceptable, the normal solution
> is
> > to use statically included destinations (see the "pure static networks"
> > section just below), but as far as I know there's no way to use wildcards
> > so you'd have to list them all in advance.
> >
> > Tim
> > On Jun 18, 2015 6:05 AM, "pubudu gunawardena" <pubudupg@gmail.com>
> wrote:
> >
> >> To elaborate more, I am using an embedded broker to gain the benefits
> >> mentioned at
> >>
> http://activemq.apache.org/how-do-i-embed-a-broker-inside-a-connection.html
> >> .
> >> But I want to dynamically create queues without knowing the name
> >> beforehand.
> >>
> >> On Thu, Jun 18, 2015 at 5:32 PM, pubudu gunawardena <pubudupg@gmail.com
> >
> >> wrote:
> >> > Hi All,
> >> >
> >> > I am quite new to ActiveMQ and am trying to figure out a solution to
> >> > the following.
> >> >
> >> > I have an embedded broker and a remote broker.
> >> > From my code I do the following to create a session on the embedded
> >> > broker and to create a queue there.
> >> >
> >> >             factory = new
> >> ActiveMQConnectionFactory("tcp://localhost:61617");
> >> >             connection = factory.createConnection();
> >> >             connection.start();
> >> >             session = connection.createSession(false,
> >> Session.AUTO_ACKNOWLEDGE);
> >> >             destination = session.createQueue("SAMPLEQUEUE");
> >> >
> >> > I want a queue with the same name to be created on the remote broker
> >> > when I do that and any messages I send to that queue on the embedded
> >> > broker to go to the remote broker.
> >> >
> >> > I have looked at the the documentation on JMS to JMS Bridge mentioned
> >> > at http://activemq.apache.org/jms-to-jms-bridge.html but it seems
> that
> >> > I have to know the queue name beforehand in order to create a
> >> > OutboundQueueBridge.
> >> >
> >> > Is there any way that I can  dynamically create the queue on the
> >> > remote broker when I call the createConnection as I have mentioned
> >> > above? Is there any configuration in the JMS to JMS bridge which
> >> > enables that?
> >> > --
> >> > Thanks,
> >> > Pubudu
> >>
> >>
> >>
> >> --
> >> Thanks,
> >> Pubudu
> >>
>
>
>
> --
> Thanks,
> Pubudu
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message