SamCooper / COM_SPEC_RIDS

1 stars 0 forks source link

Query Interaction Pattern #87

Open CesarCoelho opened 8 years ago

CesarCoelho commented 8 years ago

The Interaction Pattern for the query operation forces the last object to be put in the RESPONSE message. This causes a lot of trouble for implementers (both on provider and consumer side) and forces one to write many requirements to cope with this fact. From experience, the last RESPONSE IP should not be used to transport the last query. It should be used to acknowledge the end of the transaction.

For example, if we query the Archive and a single object is returned, should it be in the UPDATE or in the RESPONSE? A wise person would say in the RESPONSE as this is the last message however, if we do this, the MAL will give us an error because we skipped one of the stages of the pattern:

Apr 10, 2016 6:40:19 PM esa.mo.mal.impl.state.BaseOperationHandler logUnexpectedTransitionError WARNING: Unexpected transition IP(PROGRESS) Stage(2) Apr 10, 2016 6:40:19 PM esa.mo.mal.impl.MessageReceive lookupAddress WARNING: lookupAddress failed to find local endpoint for EndPointPair{first=null, second=8589934594} Apr 10, 2016 6:40:19 PM esa.mo.mal.impl.MessageReceive onMessage WARNING: Unable to return error, already a return message ({0}) MALInteractionException{standardError=(errorNumber=65551,errorName=INCORRECT_STATE,extraInformation=null)} at esa.mo.mal.impl.state.ProgressOperationHandler.processStage(ProgressOperationHandler.java:172) at esa.mo.mal.impl.InteractionConsumerMap.handleStage(InteractionConsumerMap.java:251) at esa.mo.mal.impl.MessageReceive.onMessage(MessageReceive.java:180) at esa.mo.mal.transport.gen.GENEndpoint.receiveMessage(GENEndpoint.java:361) at esa.mo.mal.transport.gen.GENTransport.processIncomingMessage(GENTransport.java:696) at esa.mo.mal.transport.gen.GENTransport$GENIncomingMessageProcessor.run(GENTransport.java:1226) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)