[jira] Commented: (AMQ-762) Message Group based load balancing not well distributed across brokers

2006-07-07 Thread Sanjiv Jivan (JIRA)
[ 
https://issues.apache.org/activemq/browse/AMQ-762?page=comments#action_36537 ] 

Sanjiv Jivan commented on AMQ-762:
--

Unfortunately SimpleMessageListenerContainer doesnt seem to be helping.

> Message Group based load balancing not well distributed across brokers
> --
>
>  Key: AMQ-762
>  URL: https://issues.apache.org/activemq/browse/AMQ-762
>  Project: ActiveMQ
> Type: Bug

> Versions: 4.0
>  Environment: Active MQ 4.0, Lingo 1.1
> Reporter: Sanjiv Jivan
>  Attachments: lingocluster.zip
>
>
> I started 2 servers, each of which have an embedded broker. A shell based 
> chield sends messages to 30 different message groups (using command "register 
> " in the samepl app provided. Only 2 mesages are received by 
> server1, 3 by server2 and 25 by server3. The load balancing distribution is 
> highly unenen. 
> As suggested, I also tried setting a low destination queue prefetch value 
> (consumer.prefetch=1) but the result was the same.
> To run sample :
> 1. Unzip attached file and run "maven.bat" from the oot directory (Maven 1.0)
> 2. Open 3 DOS boxes in the dist\bin folder and run 
> "startoptimizerPooled.bat", "startOptimizerPooled2.bat" and 
> "startOptimizerPooled3.bat" in each DOS box respectively.
> 3. Step 2 starts a network of 3 servers apps which have an embedded broker. 
> The Spring configuration files for each of these servers is in the dist\conf 
> directory.
> 4. Open another DOS box in dist\bin and start a test client by running 
> "startClientShell.bat"
> 5. This command driver test client accepts commads in the form 
> "register "
> "close "
> and "exit"
> NOTE: The command "close " is supposed to close/reset  the 
> message group by issueing a "JMSXGroupSeq" header as described here : 
> http://www.activemq.org/site/message-groups.html
> 6. Try sending several messages to the server by issuing several commands 
> like "regeister A", "register B", "register C" and so on.. You'll see the 
> highly uneven distibution of messages. Only one or two messages are received 
> my 2 servers while the third one receives a majority of the messages.
> Please let me know if you have trouble running the sample or replicating the 
> issue. 
> Thanks,
> Sanjiv

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



[jira] Created: (AMQ-769) Expose MessageGroupMap implementation to be configurable via BrokerService property

2006-06-21 Thread Sanjiv Jivan (JIRA)
Expose MessageGroupMap implementation to be configurable via BrokerService 
property
---

 Key: AMQ-769
 URL: https://issues.apache.org/activemq/browse/AMQ-769
 Project: ActiveMQ
Type: Improvement

  Components: Broker  
Versions: 4.0
 Environment: Active MQ 4.0
Reporter: Sanjiv Jivan


I need to use the SimpleMessageGroupMap implmentation of MessageGroupMap instad 
of the default MessageGroupHashBucket implmentation. Presently there's no easy 
way to do this. Additionally the member  "messageGroupOwners" in 
org.apache.activemq.broker.region.Queue is private, with no setter and the 
getter has 

public MessageGroupMap getMessageGroupOwners() {
if (messageGroupOwners == null) {
messageGroupOwners = new 
MessageGroupHashBucket(messageGroupHashBucketCount);
}
return messageGroupOwners;
}

So basically there's no easy way to use another implmentation of 
MessageGroupMap in this class. (This lazy create method is also not threadsafe. 
Might be better to default initialize messageGroupOwners )

I had to jump through a bunh of hoops, starting with subclassing BrokerService 
exposing the messageGroupOwners class, followed by overriding 
createRegionBroker() where it creates an annonymous subclass of RegionBroker , 
overriding createQueueRegion and createTempQueueRegion where I create 
subclasses of  QueueRegion and TempQueueRegion respectively to have them be 
configured to use the configured MessageGroupMap.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



[jira] Closed: (AMQ-760) many issue with network of brokers

2006-06-20 Thread Sanjiv Jivan (JIRA)
 [ https://issues.apache.org/activemq/browse/AMQ-760?page=all ]
 
Sanjiv Jivan closed AMQ-760:


Resolution: Duplicate

Created separate and more specific issues AMQ-762 and AMQ-763 

> many issue with network of brokers
> --
>
>  Key: AMQ-760
>  URL: https://issues.apache.org/activemq/browse/AMQ-760
>  Project: ActiveMQ
> Type: Bug

>   Components: Broker
> Versions: 4.0
>  Environment: XP, Active MQ 4.0, Lingo 1.1
> Reporter: Sanjiv Jivan
>  Attachments: lingocluster.zip
>
>
> I'm having a real rough time getting Active MQ 4.0 to work property when 
> deployed as a network of brokers using Message Groups. The behaviour even 
> without Message Groups seems highly unstable. I don't even know where to 
> start but I'll give it a shot. Basically every time I try to carry out any 
> manual test, like start two brokers, start client  and send message, stop one 
> server, start client etc.. I see a misbehaviour. 
> I've seen things like a single message group being sent to two different 
> servers, the client hanging, servers not responding ... etc
> Build the uploaded sample and give it play around with it and you'll see what 
> I mean. 
> 1. Open two DOS boxes and run two servers by calling 
> "startoptimizerPooled.bat" from dist\bin. First, if brokerName is specified 
> in the configuration, it fails when running on JDK 1.4 with a noclassdef 
> error on a jmx class JMXServiceURL. When using JDK 1.5 and specifying a 
> brokerName, the client hangs when a call is made to the server.
> 2. Start a client by calling "startclient.bat foobar" from dist\bin. Here 
> "foobar" translated to the Message Group ID. Terminate the client midway, and 
> restart it. Repeat and you'll see that the "foobar" message group is received 
> by both servers.
> 3. Open a third dos box and start another client and send messages as 
> described in step 2, and you'll notice strange behavior again.
> 4. When running a "network of broker", after a broker is started and has 
> received a message, when another broker is started, an exception is raised 
> immediately. Try this by opening another DOS box and running 
> startoptimizerPooled.bat.
> 5. Now try starting a broker on a different machine and repeat above test. 
> Different errors like the ones described in issue 
> https://issues.apache.org/activemq/browse/AMQ-696 start showing up.
> Too many things don't seem to be working but hopefully once these issues get 
> sorted out, I'll be able to attain Lingo nirvana.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



[jira] Created: (AMQ-763) closing of Message Groups not working

2006-06-20 Thread Sanjiv Jivan (JIRA)
closing of Message Groups not working
-

 Key: AMQ-763
 URL: https://issues.apache.org/activemq/browse/AMQ-763
 Project: ActiveMQ
Type: Bug

  Components: Broker  
Versions: 4.0
 Environment: Active MQ 4.0, XP, Lingo 1.1
Reporter: Sanjiv Jivan


I'm trying to close/reset a message group as described here : 
http://www.activemq.org/site/message-groups.html but this does not seem to be 
working.

To reproduce, use the sample app provided in issue : 
http://issues.apache.org/activemq/browse/AMQ-762

and follow the instructions provided there. Issue the command "close " on a previously sent message group (via register ). This 
is supposed to reset the message group affinity to the brokers but on issuing a 
register  for the message group just closed you'll notice that 
the server affinity still exists and this call always  goes to the server/broer 
that was previosly chosen.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



[jira] Created: (AMQ-762) Message Group based load balancing not well distributed across brokers

2006-06-20 Thread Sanjiv Jivan (JIRA)
Message Group based load balancing not well distributed across brokers
--

 Key: AMQ-762
 URL: https://issues.apache.org/activemq/browse/AMQ-762
 Project: ActiveMQ
Type: Bug

Versions: 4.0
 Environment: Active MQ 4.0, Lingo 1.1
Reporter: Sanjiv Jivan
 Attachments: lingocluster.zip

I started 2 servers, each of which have an embedded broker. A shell based 
chield sends messages to 30 different message groups (using command "register 
" in the samepl app provided. Only 2 mesages are received by 
server1, 3 by server2 and 25 by server3. The load balancing distribution is 
highly unenen. 

As suggested, I also tried setting a low destination queue prefetch value 
(consumer.prefetch=1) but the result was the same.

To run sample :

1. Unzip attached file and run "maven.bat" from the oot directory (Maven 1.0)
2. Open 3 DOS boxes in the dist\bin folder and run "startoptimizerPooled.bat", 
"startOptimizerPooled2.bat" and "startOptimizerPooled3.bat" in each DOS box 
respectively.
3. Step 2 starts a network of 3 servers apps which have an embedded broker. The 
Spring configuration files for each of these servers is in the dist\conf 
directory.

4. Open another DOS box in dist\bin and start a test client by running 
"startClientShell.bat"
5. This command driver test client accepts commads in the form 
"register "
"close "
and "exit"

NOTE: The command "close " is supposed to close/reset  the 
message group by issueing a "JMSXGroupSeq" header as described here : 
http://www.activemq.org/site/message-groups.html

6. Try sending several messages to the server by issuing several commands like 
"regeister A", "register B", "register C" and so on.. You'll see the highly 
uneven distibution of messages. Only one or two messages are received my 2 
servers while the third one receives a majority of the messages.

Please let me know if you have trouble running the sample or replicating the 
issue. 

Thanks,
Sanjiv

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



[jira] Commented: (AMQ-758) Message Groups disables server side JMS session pooling

2006-06-19 Thread Sanjiv Jivan (JIRA)
[ 
https://issues.apache.org/activemq/browse/AMQ-758?page=comments#action_36428 ] 

Sanjiv Jivan commented on AMQ-758:
--

Makes sense. I'll use the pooled executor from the concurrent library.

> Message Groups disables server side JMS session pooling
> ---
>
>  Key: AMQ-758
>  URL: https://issues.apache.org/activemq/browse/AMQ-758
>  Project: ActiveMQ
> Type: Bug

>   Components: Broker
> Versions: 4.0
>  Environment: XP, ActiveMQ 4.0 release, Lingo 1.1, Spring 2.0
> Reporter: Sanjiv Jivan
>  Attachments: lingocluster.zip
>
>
> Specifying Message Groups on the client causes serialized/ single threaded 
> processing of messages on the server side even when server side session 
> pooling is configured.
> Please find attached  sample code along with a JUnit test "MessageGroupTests" 
> that demonstrates the issue. My sample is based on Lingo. The client calls an 
> async method solve(scenarioName) and receives progress callbacks. When the 
> cleint calls cancel(scenarioName) during a solve, the cancel method on the 
> server side should be received and stop the running solve. Since a single JMS 
> session evexcutes message listeners serially, I've configured a JMS server 
> session pool of size 20 using Spring's DefaultMessageListenerContainer class.
> I've configured use of a message group via a Lingo marshaller class 
> org.sanjiv.lingo.client.MessageGroupMarshaller. This class basically sets the 
> JMS header  "JMSXGroupID" to the "scenarioName" in question so that when a 
> cluster of servers are running, the cancel(scenarioName) call is directed to 
> the server that had solve(scenarioName) called for a given "scenarioName".
> The issue is that when the message groups are enabled using the 
> MessageGroupMarshaller, the cancel(scenarioName) call blocks and waits for 
> the async solve(scenarioName) method to complete on the server (which is not 
> the right behaviour). Disabling message groups by commenting out the client 
> side MessageGroupMarshaller marshaller in 
> org/sanjiv/lingo/test/messageGroupContext.xml results in the call being 
> excuted correctly.
> I see that the docs for message groups say that message order is preserved, 
> however that should not require that the second message blocks till the first 
> message completes. Only the order in which the listeners are executes should 
> be guaranteed to be the order of message receipt.
> Let me know if you have any questions.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



[jira] Created: (AMQ-760) many issue with network of brokers

2006-06-17 Thread Sanjiv Jivan (JIRA)
many issue with network of brokers
--

 Key: AMQ-760
 URL: https://issues.apache.org/activemq/browse/AMQ-760
 Project: ActiveMQ
Type: Bug

  Components: Broker  
Versions: 4.0
 Environment: XP, Active MQ 4.0, Lingo 1.1
Reporter: Sanjiv Jivan
 Attachments: lingocluster.zip

I'm having a real rough time getting Active MQ 4.0 to work property when 
deployed as a network of brokers using Message Groups. The behaviour even 
without Message Groups seems highly unstable. I don't even know where to start 
but I'll give it a shot. Basically every time I try to carry out any manual 
test, like start two brokers, start client  and send message, stop one server, 
start client etc.. I see a misbehaviour. 

I've seen things like a single message group being sent to two different 
servers, the client hanging, servers not responding ... etc

Build the uploaded sample and give it play around with it and you'll see what I 
mean. 

1. Open two DOS boxes and run two servers by calling "startoptimizerPooled.bat" 
from dist\bin. First, if brokerName is specified in the configuration, it fails 
when running on JDK 1.4 with a noclassdef error on a jmx class JMXServiceURL. 
When using JDK 1.5 and specifying a brokerName, the client hangs when a call is 
made to the server.

2. Start a client by calling "startclient.bat foobar" from dist\bin. Here 
"foobar" translated to the Message Group ID. Terminate the client midway, and 
restart it. Repeat and you'll see that the "foobar" message group is received 
by both servers.

3. Open a third dos box and start another client and send messages as described 
in step 2, and you'll notice strange behavior again.

4. When running a "network of broker", after a broker is started and has 
received a message, when another broker is started, an exception is raised 
immediately. Try this by opening another DOS box and running 
startoptimizerPooled.bat.

5. Now try starting a broker on a different machine and repeat above test. 
Different errors like the ones described in issue 
https://issues.apache.org/activemq/browse/AMQ-696 start showing up.

Too many things don't seem to be working but hopefully once these issues get 
sorted out, I'll be able to attain Lingo nirvana.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



[jira] Created: (AMQ-758) Message Groups disables server side JMS session pooling

2006-06-17 Thread Sanjiv Jivan (JIRA)
Message Groups disables server side JMS session pooling
---

 Key: AMQ-758
 URL: https://issues.apache.org/activemq/browse/AMQ-758
 Project: ActiveMQ
Type: Bug

  Components: Broker  
Versions: 4.0
 Environment: XP, ActiveMQ 4.0 release, Lingo 1.1, Spring 2.0
Reporter: Sanjiv Jivan
 Attachments: lingocluster.zip

Specifying Message Groups on the client causes serialized/ single threaded 
processing of messages on the server side even when server side session pooling 
is configured.

Please find attached  sample code along with a JUnit test "MessageGroupTests" 
that demonstrates the issue. My sample is based on Lingo. The client calls an 
async method solve(scenarioName) and receives progress callbacks. When the 
cleint calls cancel(scenarioName) during a solve, the cancel method on the 
server side should be received and stop the running solve. Since a single JMS 
session evexcutes message listeners serially, I've configured a JMS server 
session pool of size 20 using Spring's DefaultMessageListenerContainer class.

I've configured use of a message group via a Lingo marshaller class 
org.sanjiv.lingo.client.MessageGroupMarshaller. This class basically sets the 
JMS header  "JMSXGroupID" to the "scenarioName" in question so that when a 
cluster of servers are running, the cancel(scenarioName) call is directed to 
the server that had solve(scenarioName) called for a given "scenarioName".

The issue is that when the message groups are enabled using the 
MessageGroupMarshaller, the cancel(scenarioName) call blocks and waits for the 
async solve(scenarioName) method to complete on the server (which is not the 
right behaviour). Disabling message groups by commenting out the client side 
MessageGroupMarshaller marshaller in 
org/sanjiv/lingo/test/messageGroupContext.xml results in the call being excuted 
correctly.

I see that the docs for message groups say that message order is preserved, 
however that should not require that the second message blocks till the first 
message completes. Only the order in which the listeners are executes should be 
guaranteed to be the order of message receipt.

Let me know if you have any questions.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



[jira] Commented: (AMQ-696) Client: XXX already connected exception when connection started after consumers added

2006-06-15 Thread Sanjiv Jivan (JIRA)
[ 
https://issues.apache.org/activemq/browse/AMQ-696?page=comments#action_36411 ] 

Sanjiv Jivan commented on AMQ-696:
--

fyi I ran into the very same issue with 4.0 RC3. After upgrading to the 4.0 
release jar (dated jun 13, 2006), I no longer see this error.

> Client: XXX already connected exception when connection started after 
> consumers added
> -
>
>  Key: AMQ-696
>  URL: https://issues.apache.org/activemq/browse/AMQ-696
>  Project: ActiveMQ
> Type: Bug

>   Components: Broker
> Versions: 4.0 RC2, 4.0 RC3
>  Environment: WinXP
> Reporter: Craig Day
>  Fix For: 4.0

>
>
> While using the new Spring-2.0 DefaultMessageListenerContainer I can reliably 
> reproduce the following exception on the broker side which usually results in 
> a hang on the client side:
>  
> The broker logs the following exception:
>  
> INFO  Service- Sync error occurred: 
> javax.jms.InvalidClientIDException: Broker: localhost - Client: 
> ID:inspiron-1410-114619274
> 7453-2:1 already connected
> javax.jms.InvalidClientIDException: Broker: localhost - Client: 
> ID:inspiron-1410-1146192747453-2:1 already connected
> at 
> org.apache.activemq.broker.region.RegionBroker.addConnection(RegionBroker.java:154)
> at 
> org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:65)
> at 
> org.apache.activemq.advisory.AdvisoryBroker.addConnection(AdvisoryBroker.java:69)
> at 
> org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:65)
> at 
> org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:77)
> at 
> org.apache.activemq.broker.AbstractConnection.processAddConnection(AbstractConnection.java:500)
> at 
> org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:82)
> at 
> org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:106)
> at 
> org.apache.activemq.broker.AbstractConnection.service(AbstractConnection.java:196)
> at 
> org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:62)
> at 
> org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:93)
> at 
> org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:70)
> at 
> org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:114)
> at 
> org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:122)
> at 
> org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:87)
> at 
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:139)
> at java.lang.Thread.run(Thread.java:595)
>  
> I have extrapolated the sequence of calls that 
> DefaultMessageListenerContainer is making and managed to produce a simple 
> test case that reproduces the problem:
>  
> import junit.framework.TestCase;
> import org.apache.activemq.ActiveMQConnectionFactory;
> import org.apache.activemq.command.ActiveMQQueue;
>  
> import javax.jms.*;
>  
> public class TestActiveMQ extends TestCase {
>  
> public void testConnectionFactory() throws Exception {
> final ActiveMQConnectionFactory cf = new 
> ActiveMQConnectionFactory("tcp://localhost:61616");
> final ActiveMQQueue queue = new ActiveMQQueue("testqueue");
> final Connection conn = cf.createConnection();
>  
> Runnable r = new Runnable() {
> public void run() {
> try {
> Session session = conn.createSession(false, 1);
> MessageConsumer consumer = session.createConsumer(queue, 
> null);
> Message msg = consumer.receive(1000);
> } catch (JMSException e) {
> e.printStackTrace();
> }
> }
> };
> new Thread(r).start();
> conn.start();
>  
> try {
> synchronized (this) {
> wait(3000);
> }
> } catch (InterruptedException e) {
> e.printStackTrace();
> }
> }
> }
>  
> Let us know if you need anymore information. Dont want to scrub ActiveMQ from 
> my list of candidates If I can help it.
>  
> cheers
> craig
>  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira