---------- Forwarded message ----------
From: Pierce Wetter <pie...@chegg.com>
Date: 21 December 2011 23:59
Subject: [esb-java-user] Simple EIP pattern hard to do?
To: "esb-java-u...@wso2.org" <esb-java-u...@wso2.org>



  So I'm trying to do service composition in the ESB, where I publish an
API using REST that internally will make multiple service calls and then
produce a result at the end. But it seems harder than it needs to be. I can
also do everything with a custom mediator, but I was wondering if its
possible to get a super-simple version of Aggregate that just waits for the
sent messages to return but doesn't try to parse them for me.

  Here's a simple example:

public API:

   /myapi/{magicCode}

 Internal API 1:

   /lookupUser/{magicCode}      (given a magic code, returns the user id)

  /dosSomethingWithuser/{userId}     (given a user id, do something)


So this seems like it should be simple to do, the steps are:


  1. Rewrite the incoming URL from /myapi/ to /lookupUser
  2. Send message to /lookupUser service.
  3. Wait for answer.
  4. Parse result (which is in JSON, not well formed for XML conversion!)
set "userId" property.
  5. Turn off "RESPONSE".
  6. Rewrite URL again.
  7. Send to /doSomethingWithUser URL.
  8. Forward result back to original sequence.

 At first blush, there are the clone and iterate mediators combined with
the Aggregate mediator, but this is kind of complicated. What I really want
is of a  "blockingSend" that would pause a sequence until the response
comes in. Callout does this, but in a kind of cumbersome way, and it blocks
the calling thread.

 So I'm writing my own mediator at this point that does all the work, but I
thought I would check with the list to see if I was just being stupid.

Pierce

_______________________________________________
Esb-java-user mailing list
esb-java-u...@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/esb-java-user
_______________________________________________
Carbon-dev mailing list
Carbon-dev@wso2.org
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to