Hi Amila, We have done duplicate msg testing for Sandesha2 and haven't noticed any problems. I think in your case what is happening is that a fault is being generated at the service possibly something to do with:
[ERROR] The endpoint reference (EPR) for the Operation not found is and the WSA Action = urn:InteropServiceRMDelayResponse org.apache.axis2.AxisFault: The endpoint reference (EPR) for the Operation not found is and the WSA Action = urn:InteropServiceRMDelayResponse and is then being sent back to the client. It may be worth checking your delay code is all working working properly. Another thing worth doing is checking exactly what msgs flow on the wire. Regards, Dave Dave Parsons Web Services Test INTERNAL: David Parsons1/UK/[EMAIL PROTECTED] :: DE3F20 :: 246930 EXTERNAL: [EMAIL PROTECTED] :: (01962) 816930 Mail Point 211, IBM Hursley Park, Winchester. SO21 2JN From: "Amila Suriarachchi" <[EMAIL PROTECTED]> To: David Parsons1/UK/[EMAIL PROTECTED] Cc: [email protected] Date: 07/10/2008 15:06 Subject: Re: Sandesha2 In Only services. hi David, Thank you for your responses. Please bear with me asking these questions. What I am basically tring is to evaluate the Sadesha2 status with some test cases. And check whether I can do any contribution. I tried In Out sequence. with setUserSeperateListner set to true. As you had mentioned every thing worked fine with dual channel mode. Then I tried with an annoymous case with this 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/InteropServiceRMDelay2")); serviceClient.getOptions().setAction("urn:InteropServiceRMDelay2"); serviceClient.engageModule("sandesha2"); sendAsynchornousMessage(serviceClient, 6, "Key1"); SandeshaClient.terminateSequence(serviceClient); private void sendAsynchornousMessage(ServiceClient serviceClient, int i, String key) throws AxisFault { serviceClient.getOptions().setProperty(SandeshaClientConstants.INTERNAL_SEQUENCE_ID, key); AxisCallback axisCallback = new AxisCallback() { public void onMessage(MessageContext msgContext) { System.out.println("Got the message ==> " + msgContext.getEnvelope().getBody().getFirstElement()); } public void onFault(MessageContext msgContext) { } public void onError(Exception e) { e.printStackTrace(); System.out.println("Received an error ..."); if (e instanceof AxisFault){ System.out.println("Got the error message ==> " + ((AxisFault)e).getDetail()); } } public void onComplete() { } }; serviceClient.sendReceiveNonBlocking(getTestOMElement(key + " " + i + " "), axisCallback); } Again this also worked fine. It correctly send the last message and terminate message. The I added an delay to the MessageReceiver so that the client generates some duplicate messages. Then it could not print the response I got these exceptions at the client side [ERROR] The endpoint reference (EPR) for the Operation not found is and the WSA Action = http://www.w3.org/2005/08/addressing/soap/fault org.apache.axis2.AxisFault: The endpoint reference (EPR) for the Operation not found is and the WSA Action = http://www.w3.org/2005/08/addressing/soap/fault at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:89) at org.apache.axis2.engine.Phase.invoke(Phase.java:334) at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:248) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:157) at org.apache.sandesha2.workers.SenderWorker.checkForSyncResponses(SenderWorker.java:700) at org.apache.sandesha2.workers.SenderWorker.run(SenderWorker.java:366) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595) [ERROR] The endpoint reference (EPR) for the Operation not found is and the WSA Action = urn:InteropServiceRMDelayResponse org.apache.axis2.AxisFault: The endpoint reference (EPR) for the Operation not found is and the WSA Action = urn:InteropServiceRMDelayResponse at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:89) at org.apache.axis2.engine.Phase.invoke(Phase.java:334) at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:248) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:157) at org.apache.sandesha2.workers.SenderWorker.checkForSyncResponses(SenderWorker.java:700) at org.apache.sandesha2.workers.SenderWorker.run(SenderWorker.java:366) at org.apache.sandesha2.msgprocessors.ApplicationMsgProcessor.processResponseMessage(ApplicationMsgProcessor.java:788) at org.apache.sandesha2.msgprocessors.ApplicationMsgProcessor.processOutMessage(ApplicationMsgProcessor.java:531) at org.apache.sandesha2.handlers.SandeshaOutHandler.invoke(SandeshaOutHandler.java:132) at org.apache.axis2.engine.Phase.invoke(Phase.java:318) at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:248) at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:413) at org.apache.axis2.description.OutInAxisOperationClient.sendAsync(OutInAxisOperation.java:311) at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:224) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163) at org.apache.axis2.client.ServiceClient.sendReceiveNonBlocking(ServiceClient.java:630) at org.apache.axis2.client.ServiceClient.sendReceiveNonBlocking(ServiceClient.java:580) at org.wso2.sandesha.test.client.AsyncInOutClient.sendAsynchornousMessage(AsyncInOutClient.java:349) at org.wso2.sandesha.test.client.AsyncInOutClient.inOutAsyncClient2(AsyncInOutClient.java:187) at org.wso2.sandesha.test.client.AsyncInOutClient.main(AsyncInOutClient.java:370) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:86) [ERROR] The Callback for MessageID urn:uuid:D74EC6B69F7F2778761223386936480 was not found org.apache.axis2.AxisFault: The Callback for MessageID urn:uuid:D74EC6B69F7F2778761223386936480 was not found at org.apache.axis2.util.CallbackReceiver.receive(CallbackReceiver.java:96) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:170) at org.apache.sandesha2.workers.SenderWorker.checkForSyncResponses(SenderWorker.java:700) at org.apache.sandesha2.workers.SenderWorker.run(SenderWorker.java:366) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595) Have you done this kind of tests? thanks, Amila. On Tue, Oct 7, 2008 at 3:48 PM, David Parsons1 <[EMAIL PROTECTED]> wrote: Amila, Sandesha takes it's mark off what addressing does. If addressing has added a replyTo, sandesha will set the acksTo to match. A way round this is to set a property 'SandeshaClientConstants.AcksTo' on your serviceClient. Sandesha will then no matter what set the acksTo to that value. Another way would be to use the SandeshaClient to explicitliy create the sequence. That way I believe the setUseSeparateListener property is considered also using this you can explicitly say whether to offer or not. Regards, Dave Dave Parsons Web Services Test INTERNAL: David Parsons1/UK/[EMAIL PROTECTED] :: DE3F20 :: 246930 EXTERNAL: [EMAIL PROTECTED] :: (01962) 816930 Mail Point 211, IBM Hursley Park, Winchester. SO21 2JN From: "Amila Suriarachchi" <[EMAIL PROTECTED]> To: David Parsons1/UK/[EMAIL PROTECTED] Cc: [email protected] Date: 07/10/2008 08:43 Subject: Re: Sandesha2 In Only services. On Mon, Oct 6, 2008 at 8:11 PM, David Parsons1 <[EMAIL PROTECTED]> wrote: Hi, In answer to your questions: Why not sending ack back on new connection? If you want the Ack to come back on a separate connection you'll need to setUseSeparateListener(true) and call sendRecieve() and not fireAndForget(). This is my scenario. I have an in Only operation and I want to invoke that using WS-RM or Sandesha2. Since my operation is in only I can not use the sendReceive(). So it should be fireAndForget(). As I understood WS-RM 1.0 [1] describes a two channel protocol. So the CreateSequenceResponse and Acknowledgments should come in separate channels. Here it assumes a addressable client and server sends responds to that end point. The way now it operates is the way it describes in the Replay Model [2]. So my question is how can I make this invocation compatible with WS-RM 1.0 spec. IMHO if isUseSeperateListner is set Sandesha2 should set those reply to address correctly. [1] http://specs.xmlsoap.org/ws/2005/02/rm/ws-reliablemessaging.pdf [2] http://wso2.org/files/ws-rm-replay-model-1.0.3.pdf This will make WSAddressing add a replyTo header and from this sandesha will know to set the acksTo to the same address. If you want to set the replyTo to a specific predetermined endpoint you need to explicitly set the replyTo on the ServiceClient and then cal fireAndForget(). yes this is correct. Even in this case I believe the operation at the server side should be in out. Sandesha2 not recovering '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'm not sure what you mean by this. Are you restarting the server hosting your client? What do you mean by restarting your sequence? This is what I did. 1. Start the client. so that initial create sequence fails. 2. After some time Start the server. Further I noticed if I start the server with a little gap still Sandesha2 client can send the sequence correctly. So this may be an issue with Retransmission count. I'll have another look. Two storage Managers in Sandesha2 module.xml I believe this is fine. Only one storage manager will ever get used. Nevertheless i'm not sure why they both exist like that in the module.xml. Why offering for one way request? Sandesha2 will offer if RM 1.0 is requested and it finds the operation being called is twoway or axis has defined that an outIn MEP is being used. I'd have thought that by calling fireAndForget() axis wouldn't set the MEP constant to outIn and therefore you wouldn't see the offer. I wonder if because you have setUseSeparateListener(true) it has set this. Nope. Even I remove this line it does not change any thing. As I saw for fireAndForget Operations this variable is not relavent in Sansesha2. thanks, Amila. Regards, Dave Dave Parsons Web Services Test INTERNAL: David Parsons1/UK/[EMAIL PROTECTED] :: DE3F20 :: 246930 EXTERNAL: [EMAIL PROTECTED] :: (01962) 816930 Mail Point 211, IBM Hursley Park, Winchester. SO21 2JN From: "Amila Suriarachchi" <[EMAIL PROTECTED]> To: "[email protected]" <[email protected]> Date: 06/10/2008 10:31 Subject: Sandesha2 In Only services. 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/ Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/ Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/ Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
