hi,
I wrote an InOnly service and tried to invoke it using the following client.
ConfigurationContext configurationContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(
AXIS2_REPOSITORY_LOCATION,
AXIS2_CLIENT_CONFIG_FILE);
ServiceClient serviceClient = new
ServiceClient(configurationContext, null);
serviceClient.setTargetEPR(new EndpointReference("
http://localhost:8088/axis2/services/TestInService"));
serviceClient.getOptions().setAction("urn:TestInOperation");
serviceClient.engageModule("sandesha2");
serviceClient.getOptions().setUseSeparateListener(true);
serviceClient.getOptions().setProperty(SandeshaClientConstants.INTERNAL_SEQUENCE_ID,
"key1");
System.out.println("Invoke client using thread ==> " +
Thread.currentThread().getName());
for (int i = 1; i < 100; i++) {
serviceClient.fireAndForget(getTestOMElement(i));
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
}
serviceClient.getOptions().setProperty(SandeshaClientConstants.LAST_MESSAGE,
Constants.VALUE_TRUE);
serviceClient.fireAndForget(getTestOMElement(11));
The sequence went fine. But although I have set
serviceClient.getOptions().setUseSeparateListener(true); Sandesha2 send and
receive messages in same channel.
So how can I set it to work in dual channel (i.e with addressing reply to)?
Then I do the above test randomly starting and stopping the tcp channel
using the Tcp mon. Sandesha2 could recover messages and
every thing worked fine. Then I start the client without starting the
sequence and the server started after some time. In this case it
could not recover messages. I did not make any changes to module.xml so I
believe it uses default value.
Has any one face this problem?
Finally I saw this in sandesha2 module.xml this,
<sandesha2:StorageManagers>
<sandesha2:InMemoryStorageManager>
org.apache.sandesha2.storage.inmemory.InMemoryStorageManager
</sandesha2:InMemoryStorageManager>
<sandesha2:PermanentStorageManager>
org.apache.sandesha2.storage.inmemory.InMemoryStorageManager
</sandesha2:PermanentStorageManager>
</sandesha2:StorageManagers>
What is the purpose of having two storage managers? Isn't this cause
problems in handling transactions?
Can someone please help me figuring out these issues?
thanks,
Amila.
--
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/