hi jaliya,
I could sucessfully do this test.
MercuryClient --> Mercury sample Service using Mercury and Sandesha2 jars
Here are the steps.
First go to the mercury-0.91/samples/sample1 /server/conf and change the
services.xml
(replace the Mercury with the sandesha2)
Run the build script. This generates the service with the Sandeshas2.
Then copy the Sandesha2 1.3 jars and mars to tomcat (I used 5.5.20).
That's it. you have the Mercury equivalent Sandesha2 service.
I did not do any changes and did not copy any jars. So Sandesha2 should work
on inmemory mode.
Then I send 100 messages with two sequences for the two services using this
code. Same as in the sample.
public void testRMSequence(boolean isDuplex){
try {
ConfigurationContext configurationContext =
ConfigurationContextFactory
.createConfigurationContextFromFileSystem(
AXIS2_REPOSITORY_LOCATION,
AXIS2_CLIENT_CONFIG_FILE);
SampleServiceStub sampleServiceStub =
new SampleServiceStub(configurationContext,
"
http://localhost:8080/axis2/services/SampleService",
isDuplex);
sampleServiceStub._getServiceClient().engageModule("addressing");
sampleServiceStub._getServiceClient().engageModule("Mercury");
for (int i = 0; i < 100; i++) {
sampleServiceStub._getServiceClient().getOptions().setProperty(MercuryClientConstants.INTERNAL_KEY,
"key1");
sampleServiceStub.receiveInt(i);
sampleServiceStub._getServiceClient().getOptions().setProperty(MercuryClientConstants.INTERNAL_KEY,
"key2");
sampleServiceStub.receiveInt(i);
}
MercuryClient mercuryClient = new
MercuryClient(sampleServiceStub._getServiceClient());
mercuryClient.terminateSequence("key1");
mercuryClient.terminateSequence("key2");
try {
Thread.sleep(40000);
} catch (InterruptedException e) {
e.printStackTrace();
}
} catch (AxisFault e) {
e.printStackTrace();
} catch (java.rmi.RemoteException e) {
e.printStackTrace();
}
}
What I observed in the tomcat console was Mercury process the messages in
Quick time. But
with sandesha2 the numbers appear is almost countable.
I did this in my local machine. Jaliya could you please do the same using
the server you have used earlier.
you can get the changed jar from here[1]. But if you test with 50 message
sequences with 0.91
you should be able to observe this.
thanks,
Amila.
[1] http://ww2.wso2.org/~amila/mercury-core-SNAPSHOT.jar