Need help in a particular scenario of PublishAndWait

Here is my question :
I am using webMethods 6.1, Solaris, SQLSERVER2000.
I have written a flow service to capture the data and do a publishandwait.
On the otherside I have a subscribing service which gets the published data and inserts the data into sqlserver. Once the data is inserted It immediately picks up the data from the second table. it formulate the resultset and does a publish:reply.
This scenario works when the target tables are empty and there are no records. When I do a publishandwait second time it goes into infinite loop. I see the document in the broker which is not picked up by the subscribing service.
I am really puzzled. First time it works and and second time the target service does not even get the data which is published.

Help me in debugging this issue.
And also If I get a package which uses publishandwait, reply It would be of great help.

Please let me know if you require any more information
Thank you in-advance

Hello,
So if you delete the record from the table after the second document posts, will your service come out of the infinite sleep? If you do a plain publish, will you still have the same issues? Good day.

Yemi Bedu

Yes. If I delete the record from the table the next transaction will go through fine. Actually I need to send the reply back so I am using publishandwait. Just plain publish will not help me in that case.
Further inputs will be of great help.
Thanks in-advance

Hello,
I know it doesn’t help directly, but could you try to do plain publish call of the document just before a publishAndWait call. I would like to know if it is directly linked to publishing/replying calls or something else.
Also, what data are you sending in the reply. You know, which fields are filled with what values (types at least). Thank you. Good day.

Yemi Bedu

Hi,
I did do the test which you mentioned and you are right even with publish the document gets stuck in the broker. (Probably 'coz of service usage of my service is still holding the old document)
The reply document contains all string variable.
I see in the service usage tab and my service shows its in use. Is there anyway to clear service usage cache apart from reload of package ?
Thanks in advance

Ram,

Did you tried to clear the service cache from the developer?but I am not sure if service usage releases it unless server restart etc…

I hv reset server cache and also reset service cache using Admin Console window. That did not help. How do we do from developer ? did u mean reload package ? OR IS restart is only the way ?

RMG,
My intent for this thread was something different which i stated above. I need help for publishandwait implmentation. I have tried all other means I am lost. A sample package on this would give me a great relief. If I don’t get the solution for the above problem

Any help ?

“Once the data is inserted It immediately picks up the data from the second table.”

How? Need details on what your subscriber is doing specifically. How it does the insert, how it picks up the data from the second table, how control returns from this service so that the doc on the Broker gets ack’d, etc.

“When I do a publishandwait second time it goes into infinite loop.”

Do you really mean infinite loop? Or is something just stalled? If a loop, what loop?

Hi Please find below the answers for your question
How ?
On the subscribing service there is a insert operation on inbound table. A trigger is configured for that table. Once the data is inserted there is some operation being performed(which is basically takes less than 1-2 secs) and the result of it is put in the oubound table. After this step there is repeat step under which a select operation is used on the outbound table. Once the outbound table receive’s data it comes out of repeat step and formulates the document type and is sent to pub.publish:reply.
The document type is same as the receivedocumenttype in publishandwait.

Infinite loop ?

  1. When I do a unit testing using developer by running my flow service it starts processing and never finishes.
  2. I see the document on the broker without getting processed.
  3. The service usages tab shows the number of documents sitting on publishandwait.

Also please let me know if you need any more information.

Thanks

“…there is repeat step under which a select operation is used on the outbound table.”

You might check that this repeat is operating as expected. My suspicion is that the repeat is looping forever and therefore the reply never gets generated, thus the next request event will never be retrieved from the Broker. This is just a guess on my part.

Ram,
You should also check that you are replying correctly to the waiting service. Doesn’t sound like the waiting service is picking up the document. The default setting on publish/wait is no timeout, hence it will sit there and block until it gets the document. If you have no other services using this same published document, try using publish/deliver and set the timeout to something low for testing (minute or so).

markg
http://darth.homelinux.net

Good advice Mark. I’d add that a pub/wait should never, ever, ever wait forever. There should always be a timeout.

Hello,
Yes that sounds interesting. You know, given your setup, you don’t really need to do a publish and subscribe to test the service. You can just call the service directly and supply the input document. That way, you can directly step into it and see what would have been the reply to come out of the service call. If you can eliminate most of the other possible causes for failure and freezing, you will know better if you should focus on the actual publish/reply mechanisms. Good day.

Yemi Bedu

Hello,
One other thing, is the data coming from the second table a blind pull, or a trigger pull. That would mean that you have a secondary trigger that is doing the reply to the first publish. Is it something like:
publish1 -> trigger1 -> mod table -> insert notification -> trigger2 -> reply to publish1.
Maybe there is an ID issue on the reply. Good day.

Yemi Bedu

Yes. There is an id on reply. On the repeat step it continues the operation till it receives that particular ID. Once a record with that ID is in outbound table it comes out of that repeat and then formulate the document type and is sent to pub.publish:reply.
I don’t know why my publishandwait is not getting reply.

Rob,
I have done thoroughly tested my repeat step. And I am sure that is not the problem. Initially I thought the same that repeat step could be the problem, but its not.

These are the step of process
publishandwait–>Insert(inbound)–>RepeatStart(Db Operations : Trigger(fired)–>SomeOperation–>PutsData(Outbound))–>SelectOperationPicks–>RepeatEnds–>formulate DT–>pub.publish:reply

Sorry for the typo !!!
Rob,
I have thoroughly tested my repeat step. And I am sure that is not the problem. Initially I thought the same that repeat step could be the problem, but its not.

What are the parms to pub.publish:reply? Have you confirmed the receivedDocumentEnvelope parameter is not null during execution? Any errors indicated in the error or server logs? Does the doc type specified in the receiveDocumentTypeName parameter of the pub.publish:publishAndWait match the documentTypeName parameter of the pub.pulish:reply exactly? Does the reply doc actually make it to the Broker?

Yes. The doc type specified in the receiveDocumentTypeName parameter of the pub.publish:publishAndWait match the documentTypeName parameter of the pub.pulish:reply exactly.
No. There is no error on server log.

I guess an example should do. If anybody has worked on this and have sample package that would be of great help.
Thank you for all your support.