activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Tully <gary.tu...@gmail.com>
Subject Re: Detecting if a message was routed between multiple brokers in an interceptor
Date Wed, 02 Jan 2013 13:38:41 GMT
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 <jimwert@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

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