First off all I’m just beginning with webMethods IS :D(yehai) right now so sorry if there is some misspelled information…
When we want to use publishAndWait there are two alternatives sync or async. The async way provides a implementation to multi-threading.
Having an architecture as the following (for example):
-Two services: one that calls publishAndWait (first service) and another who calls the reply (second service)
-Two documents: one publish by the first service and the other that gets “replyed” by the second service
Synchronized publishAndWait
On the sync approach the flow in the first service will stop until it receives a reply from a service who subscribed the previous published document.
By other means the output will have the output variables as stated:
tag = null
document = document received from reply
Asynchronous publishAndWait
Using these paradigm we will require to use service waitForReply as well so that we only get a tag variable filled from the publishAndWait call.
tag = IS auto generated id
document = null
With this tag variable we can call waitForReply and get the desired associated reply!
So basically my doubt is:
Is there a difference between an Asynchronous publishAndWait and a normal publish if we don’t use a waitForReply?
And by that I mean an Asynchronous publishAndWait is useless without a waitForReply…
And another thing if we put the waitForReply immediately after an Asynchronous publishAndWait (in the flow) the we are actually making a sort of
Synchronized publishAndWait :rolleyes:
ps: i searched the forum but I didn’t actually saw a description of how to implement stuff like this and how it worked so after reading the manuals and implementing some examples i got to this conclusions.
tks for your time cheers