Reputation: 754
Context: I have an XML based API. I get requests using this API. Then I have transformers that transform this requests into a 3rd party specific API. Then I do a web-service call using the transformed object, get back some response that I transform back to my API object.
In one line it's like:
MY_API_REQ -> 3RD_PARTY_API_REQ -> WS-CAL -> 3RD_PARTY_API_RES -> MY_API_RES
Dead simple.
Problem: Now, I want to echo back some parts of my request in my response.
So let's say my request API has an Echo component that must be present in the response also. The simplest solution appears to me that I store somewhere (for e.g.: in session scoped header property) this Echo component before transforming my request to API of 3rd party. Then on the response branch I retrieve this Echo component and set it on my response object.
In one line it's like:
MY_API_REQ -> Store parts -> 3RD_PARTY_API_REQ -> WS-CAL -> 3RD_PARTY_API_RES -> MY_API_RES -> Retrieve and set stored parts
Concern: This solution doesn't make my feel like I'm using the best possible solution. Partially cause I'm afraid that there are copy mechanisms during execution of the flow that I'm not aware of and that makes me worried about performance...
I'm doing all of this synchronously so I should be on the same thread all the way down so maybe my concerns has no bases what so ever. However before doing some performance testing or profiling I wanted to ask you guys about this...
Laziness is half healthiness. ;) Thanks in advance: T
Upvotes: 0
Views: 187
Reputation: 33413
There are two different approaches (you're using the first one):
Upvotes: 1