-
1. Re: Cluster messaging distribution
timfox Dec 29, 2008 5:31 AM (in response to rana24)The first node is chosen randomly when creating the first connection from a clustered connection factory.
See http://www.jboss.org/file-access/default/members/jbossmessaging/freezone/docs/userguide-1.4.2.GA/html/c_configuration.html#c_conf.clusteredcfs
In your case, you only create one connection on the cf before throwing it away, so it will always be random.
Round robin only applies to subsequent connections from the same connection factory. -
2. Re: Cluster messaging distribution
rana24 Dec 29, 2008 5:39 AM (in response to rana24)Thanks Tim,
Okey I got it now.
So if we have multiple stand alone clients which independently throws message. is there anything by which we can get message distribution in round robbin fashion. ( I can see one way , by implementing WebClient and exposing it through Apache Load balancer). -
3. Re: Cluster messaging distribution
timfox Dec 29, 2008 5:40 AM (in response to rana24)"rana24" wrote:
So if we have multiple stand alone clients which independently throws message. is there anything by which we can get message distribution in round robbin fashion.
Yes, like it says in the docs, only the first node is chosen randomly, the subsequent ones are chosen round robin from the same connection factory. -
4. Re: Cluster messaging distribution
rana24 Dec 29, 2008 5:45 AM (in response to rana24)In our case , each stand alone client will be sending only one message...so ideally they will do following
Lookup ConnectionFactory,
Create Connection,
LookUp Queue
and send
But what I would like to achieve is if first stand alone client has sent it to server A, the next Stand alone client should talk to Server B.
Is that feasible with current framework ? -
5. Re: Cluster messaging distribution
timfox Dec 29, 2008 5:50 AM (in response to rana24)"rana24" wrote:
In our case , each stand alone client will be sending only one message...so ideally they will do following
Lookup ConnectionFactory,
Create Connection,
LookUp Queue
and send
But what I would like to achieve is if first stand alone client has sent it to server A, the next Stand alone client should talk to Server B.
I don't think this is feasible. For Client B to connect to Server B it would have to know that Client A had "previously" connected to Server A. That means inter client communication, which is a) slow b) complex c) probably isn't even possible due to firewalls etc. -
6. Re: Cluster messaging distribution
timfox Dec 29, 2008 5:52 AM (in response to rana24)BTW - looking up a connection factory, create a connection, to send every message is a classic *anti-pattern*.
Don't do it, it will be slow. -
7. Re: Cluster messaging distribution
rana24 Dec 29, 2008 5:57 AM (in response to rana24)Thanks Tim for your suggestion,
Will sit and try to get rid of this anti-pattern. -
8. Re: Cluster messaging distribution
rana24 Dec 29, 2008 9:59 AM (in response to rana24)Tim,
To get rid off anti pattern stuff,
We have a Servicelocator implementation , which keeps a static map of Queue ,ConnectionFactory and other objects.
So we are not creating or looking up new Queue everytime, but trying to use it from map.
I seriously doubt abt. this because the stored Queue might be from any one server of the cluster so, message would go to that server only right ?
Am i thinking in right direction ?
If yes , so we need to look up Queue everytime from existing Factory right ?
Your comment will help us.