You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by exabrial <ex...@gmail.com> on 2016/05/11 15:07:45 UTC
Why does having a staticallyIncludedDestination create a consumer?
I'm creating a hub-spoke network of brokers. I'd like the edge brokers to
forward their messages to the hub so I don't have a ton of small backing
stores of messages hanging around.
So on the "spoke" broker, I have this network connector:
<networkConnectors>
<networkConnector
name="tomee1_outbound_nc"
duplex="true"
networkTTL="2"
uri="static:(tcp://localhost:61616)">
<staticallyIncludedDestinations>
<queue name=">" />
</staticallyIncludedDestinations>
</networkConnector>
</networkConnectors>
When I connect it to the hub and log into the hub's admin console, it shows
a consumer has also been created. If I attach another spoke to the hub, the
message from the first spoke will get forwarded to the new spoke even though
no consumers have registered demand, and even odder yet, the hub shows that
two consumers now exist on the network.
I'm guessing that I'm misunderstanding how staticallyIncludedDestinations
works. Is there a way to forward the messages to the hub when it's
available, but store them locally if it's not?
--
View this message in context: http://activemq.2283324.n4.nabble.com/Why-does-having-a-staticallyIncludedDestination-create-a-consumer-tp4711832.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Why does having a staticallyIncludedDestination create a consumer?
Posted by Tim Bain <tb...@alumni.duke.edu>.
Because that's what staticallyIncludedDestinations does: it forwards
messages when there isn't a consumer on the other end. By contrast,
dynamicallyIncludedDestinations forwards messages only when there is a
consumer on the other end (i.e. on demand).
On May 12, 2016 8:23 AM, "exabrial" <ex...@gmail.com> wrote:
> Ok, that makes sense then why there are two consumers.
>
> What's strange to me is the message will travel from spoke1->hub->spoke2
> even if there are no consumers on spoke2 if I have
> staticallyIncludedDestinations set on the spokes. Why is that?
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Why-does-having-a-staticallyIncludedDestination-create-a-consumer-tp4711832p4711861.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Re: Why does having a staticallyIncludedDestination create a
consumer?
Posted by exabrial <ex...@gmail.com>.
Ok, that makes sense then why there are two consumers.
What's strange to me is the message will travel from spoke1->hub->spoke2
even if there are no consumers on spoke2 if I have
staticallyIncludedDestinations set on the spokes. Why is that?
--
View this message in context: http://activemq.2283324.n4.nabble.com/Why-does-having-a-staticallyIncludedDestination-create-a-consumer-tp4711832p4711861.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Why does having a staticallyIncludedDestination create a consumer?
Posted by Tim Bain <tb...@alumni.duke.edu>.
Use two simplex connections, and only set staticallyIncludedDestinations on
the hub side. Then messages will go to the hub and stay there, until
consumers connect to the hub to consume them. If instead they'll be
connecting to spoke brokers, then you need to read the Stuck Messages
section of the page Chris linked to in order to allow a message to go back
to a broker it's already been to. Also, you'll probably want a much higher
TTL value, because you may end up with circuitous message routing.
Tim
On May 11, 2016 11:20 AM, "Christopher Shannon" <
christopher.l.shannon@gmail.com> wrote:
> A consumer will be registered for each end of the network connector (that's
> how the messages are received by the brokers).
>
> If staticallyIncludedDestinations are used then messages will always be
> send to the remote brokers even if there are no registered consumers. If
> you use dynamicalyIncludedDestinations then the messages will only be sent
> if a consumer exists on the remote broker. Take a look at the the config
> options here for more info:
> http://activemq.apache.org/networks-of-brokers.html
>
> On Wed, May 11, 2016 at 11:07 AM, exabrial <ex...@gmail.com> wrote:
>
> > I'm creating a hub-spoke network of brokers. I'd like the edge brokers to
> > forward their messages to the hub so I don't have a ton of small backing
> > stores of messages hanging around.
> >
> > So on the "spoke" broker, I have this network connector:
> >
> > <networkConnectors>
> > <networkConnector
> > name="tomee1_outbound_nc"
> > duplex="true"
> > networkTTL="2"
> > uri="static:(tcp://localhost:61616)">
> > <staticallyIncludedDestinations>
> > <queue name=">" />
> > </staticallyIncludedDestinations>
> > </networkConnector>
> > </networkConnectors>
> >
> > When I connect it to the hub and log into the hub's admin console, it
> shows
> > a consumer has also been created. If I attach another spoke to the hub,
> the
> > message from the first spoke will get forwarded to the new spoke even
> > though
> > no consumers have registered demand, and even odder yet, the hub shows
> that
> > two consumers now exist on the network.
> >
> >
> > I'm guessing that I'm misunderstanding how staticallyIncludedDestinations
> > works. Is there a way to forward the messages to the hub when it's
> > available, but store them locally if it's not?
> >
> >
> >
> > --
> > View this message in context:
> >
> http://activemq.2283324.n4.nabble.com/Why-does-having-a-staticallyIncludedDestination-create-a-consumer-tp4711832.html
> > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >
>
Re: Why does having a staticallyIncludedDestination create a consumer?
Posted by Christopher Shannon <ch...@gmail.com>.
A consumer will be registered for each end of the network connector (that's
how the messages are received by the brokers).
If staticallyIncludedDestinations are used then messages will always be
send to the remote brokers even if there are no registered consumers. If
you use dynamicalyIncludedDestinations then the messages will only be sent
if a consumer exists on the remote broker. Take a look at the the config
options here for more info:
http://activemq.apache.org/networks-of-brokers.html
On Wed, May 11, 2016 at 11:07 AM, exabrial <ex...@gmail.com> wrote:
> I'm creating a hub-spoke network of brokers. I'd like the edge brokers to
> forward their messages to the hub so I don't have a ton of small backing
> stores of messages hanging around.
>
> So on the "spoke" broker, I have this network connector:
>
> <networkConnectors>
> <networkConnector
> name="tomee1_outbound_nc"
> duplex="true"
> networkTTL="2"
> uri="static:(tcp://localhost:61616)">
> <staticallyIncludedDestinations>
> <queue name=">" />
> </staticallyIncludedDestinations>
> </networkConnector>
> </networkConnectors>
>
> When I connect it to the hub and log into the hub's admin console, it shows
> a consumer has also been created. If I attach another spoke to the hub, the
> message from the first spoke will get forwarded to the new spoke even
> though
> no consumers have registered demand, and even odder yet, the hub shows that
> two consumers now exist on the network.
>
>
> I'm guessing that I'm misunderstanding how staticallyIncludedDestinations
> works. Is there a way to forward the messages to the hub when it's
> available, but store them locally if it's not?
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Why-does-having-a-staticallyIncludedDestination-create-a-consumer-tp4711832.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>