Hi all,
In case where we use get(req) and put(rsp) instead of get_next_item(req) and item_done() - the cookbook says that its a good practice to clone the req item to rsp item and then call rsp.set_id_info(req).
- When we do a clone isn’t the id info copied as well?
- If its not then why?
- If yes then do we need to do the set_id_info separately?
Following is the code from the cookbook for reference:
$cast(rsp_item, req_item.clone()); // Create a response transaction by cloning req_item
rsp_item.set_id_info(req_item); // Set the rsp_item sequence id to match req_item
Thanks in advance.