I have a set of 3 web service calls that I need to chain together, using the response from one call to generate the request for the next call. I’ve used the java/ws-rawclient protocol for these threads to allow for using JSON. In the web service (ws) threads, I wait for a reply, then use a static route to process the reply and send it on to the next ws thread. This works well for the first two calls – the reply from the first ws call is sent as a reply message to the second ws call. However, the second ws reply is sent as a data message rather than a reply message to the third ws thread. So it looks like cloverleaf is flipping the message type on each reply – the first ws thread takes a data message and returns a reply message; the second ws thread takes a reply message and returns a data message. As a result, the reply route in the second ws thread isn’t getting used, and cloverleaf gives me an error stating the there is no route for the trxid. I’ve used SMAT to confirm the message types are getting set as described above, have written the following tcl proc that I put in the reply route for the first ws call.
set msgIn [msgget $mh]
set mh2 [msgcreate -recover -type data $msgIn]
msgmetaset $mh2 DESTCONN [msgmetaget $mh DESTCONN]
lappend dispList “KILL $mh”
lappend dispList “CONTINUE $mh2”
return $dispList
This solves the problem, but seems like a hack, and also gives me the following warning:
[msi :msi :WARN/0:redcap_getRecordIDs_xlate:04/27/2020 22:37:10] msiXlateMsgDone: Invalid MSI index -1
[msi :msi :WARN/0:redcap_getRecordIDs_xlate:04/27/2020 22:37:10] msiAddPostXlate: Invalid MSI index -1
[msi :msi :WARN/0:redcap_getRecordIDs_xlate:04/27/2020 22:37:10] msiRemovePostXlate: Invalid MSI index -1
So, is this warning something I should pay attention to, and is there a better way to accomplish what I’m trying to achieve, like using OVER or some other disposition in the reply route? Maybe relaying the message through another thread? Alternating reply routes with data routes (not a fan of this one)? Anything???
Thanks,
Don Martin