Hi ,
I have gone through the earlier emails and soultions offered for
configuring SM for clustering.
I have finally manged to have a setup that works ...partially!.
I have 2 SM instances deployed as WARs on 2 different Tomcat servers on the
same machine.
Both of them define the same JBI endpoints ( service Qname + endpointname )
. The broker names and ids are different and also the ActiveMQ
transportConnectors are configured for different ports.
The container is configured to use JMS flow and discoveryUri is set to
multicast://default.
>From the log , I see that the 2 SM instances autodiscover the endpoints . (
Note that the endspoints have the same JBI name )
When a client submits 2 requests , each request gets accepted by one SM
instance but then processing happens in any one of the instances.
I assume that since the JBI endpoint name is same on both the instances ,
any one of them will accept and process the request. Hence loadbalancing is
taking place.
I now have the following issues:
1) When I shutdown the second tomcat server , the SM instance on that does
send out a "broadcasting info " for the endpoints and then a "Stopping jms
flow" but then displays a "MulticastDiscoveryAgent |
ticast.MulticastDiscoveryAgent 262 | failed to process packet:
java.net.SocketException: Socket closed" error
Tomcat then hangs and I have to manually kill the process.
In the log for the other instance on the first tomcat , I see the following
error :
JMSFlow | mix.jbi.nmr.flow.jms.JMSFlow$3 289 | Error
processing incoming broadcast message
java.lang.NullPointerException
at
org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow$3.onMessage(JMSFlow.java:279)
at
org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:795)
at
org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:96)
Not sure why these errors are occuring.
2) After the second tomcat is killed , and I resubmit the 2 messages , the
first SM instance still tries to deliever the message to the other SM
instance , fails and hangs.
3) Is there a way that when the other server goes down my first server
starts processing all the requests . Once the server comes back up , the
primary first server again starts loadbalancing and distributing the
messages. I assumed I would see this behaviour but not sure if I do need to
make additional configuration settings.
4) I have read in the eariler posts that If I want to automatically choose
the Endpoints ( based on some conditions like load ) , I need to create a
Endpoint chooser.
Does anyone know how to do this exactly.
I do not want to change the client code where the message is created and
sent :
InOut inout = createInOutExchange(new QName("http://myns", "myservice"),
null, null);
..
send(inout);
but I want to choose the endpoint automatically. for eg : if local endpoint
with that name is present then use that first , if not , pick one of thee
remote endpoints of the same name ...or use some other logic.
Any pointers on how I can set this in broker ?
thanks
Pat
--
View this message in context:
http://www.nabble.com/Choosing-Endpoints..-tf3026853s12049.html#a8409038
Sent from the ServiceMix - User mailing list archive at Nabble.com.