You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Gary Tully <ga...@gmail.com> on 2013/01/02 14:38:41 UTC

Re: Detecting if a message was routed between multiple brokers in an interceptor

A network connector looks like a normal consumer to the broker but the
consumerInfo (associated with the subscription) has a boolean
attribute networkSubscription=true.
>From an onSend, you can find the destinationName, get the corresponding
broker destination (from the regionBroker) and query its
consumers/subscribers list. The presence of a networkSubscription consumer
means that the message may go remote.
Using decreaseNetworkConsumerPriority=true on a  network connector will
give local consumer priority.



On 28 December 2012 20:45, BocaJim <ji...@gmail.com> wrote:

> Hello all,
>
> I have an interceptor that is monitoring the onSend() method, and I would
> like to know if the message is going to be delivered to a queue "locally"
> or
> if the message is going to be routed to another broker to be delivered to
> the client.  In our network, it looks like this: (C=client, B=broker)
>
> Each client is subscribed to a single and unique queue (ie consumer count
> for all queues is exactly 1.
>
> C1 (Q1) -> B1
> C2 (Q2) -> B1
> C3 (Q3) -> B2
> B1 <-> B2 via 2 network connectors
>
> C1 puts a message in Q2, then C2 receives the message, and it is dispatched
> locally by B1 without sending the message to B2...
>
> C1 puts a message in Q3, then C3 receives the message after B1 forwards the
> message to B2.
>
> The intercepted method that catches the publish from C1 to either Q2 or Q3
> is where I would like to know if delivering to Q2 or Q3 is "local" or
> "remote" to the broker its running on (both B1 and B2 are running the
> interceptor code).
>
> Is there any way to do this?
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Detecting-if-a-message-was-routed-between-multiple-brokers-in-an-interceptor-tp4661164.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
http://redhat.com
http://blog.garytully.com