Receive and send response from same thread

Clovertech Forums Cloverleaf Receive and send response from same thread

  • Creator
    Topic
  • #121064
    MiteshBhatt
    Participant

      Hi All –

      I have this requirement wherein the FR_ (Java) thread receives the messages and sends it to Route, which will have an X-late to parse and manipulate the JSON. The manipulated JSON needs to be sent back the FR_ thread and back to the client in a synchronous fashion.

      Anyone has done sending the reply back to the original fr_thread to the person sending the request?

      How do we do this?

      Like have a fr and to threads and then TO can have the OVER back to state1? and then back to FR? and how would the msg. when received by FR know the sender’s details?

      Can anyone help?

    Viewing 1 reply thread
    • Author
      Replies
      • #121065
        Jim Kosloskey
        Participant

          I think you could do this in one thread.

          Route the thread fr thread to itself with an Xlate. Or use the 2 threads if that fits your eye better and makes it clearer to an observer what is going on.

          As to the data needed from the fr thread, if the data needed is in the ctual message (and your release of Cloverleaf allows it) check on the ‘Store original data in metadata’ box in the Route Definition. Then Tcl (perhaps in the OB Tps or pre-write) can parse the data to extract what is needed – or on the fr thread use some Tcl where appropriate in the protocol used to capture the data needed downstream and place it in the metadata User Field (be sure to use a keyed list for your entry).

          I think the above should work.

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

        • #121066
          MiteshBhatt
          Participant

            Hi Jim – Thanks for your reply. I did what you said and seems like I am getting the response back.

            Appreciate your help on this Jim!!

        Viewing 1 reply thread
        • You must be logged in to reply to this topic.