Callout mediator and send mediator - wso2

I am confused with the above two mediators. What is the difference between Call out mediator and send mediator in wso2ESB mediators?

Actually callout mediator makes a blocking call, it cannot use the default non-blocking http/s transports based on Java NIO. But the send mediator makes aynchronous call for services. This is the basic difference between them. For more about those you can refer the documentation;
http://docs.wso2.org/display/ESB470/Mediators

Additionally to callout mediator WSO2 ESB team has introduced another brand new mediator to serve blocking call to Backend. "Call Mediator" is very similar to the Callout Mediator, which performs a blocking external service invocation during mediation. Unlike the Callout mediator, the Call mediator leverages the non-blocking transports for much greater performance.

Related

Can WSO2 MB handle HTTP requests?

I've been working with WSO2 Message Broker in order to publish and consume messages through jms and other clients. I've gone through the official documentation including the samples.
What I want to know is that, is it possible for WSO2 MB to handle http requests directly instead of jms. Yes you can do something like this, by converting http to jms through WSO2 ESB which seems like a long process.
ie: I mean having http as the end point or the transport to publish and consume messages directly in WSO2 Message Broker.
In order to achieve this, you will have to use ESB + MB set up as explained at [1]. What you can do is to use ESB to wrap JMS functionality using a HTTP client. It is recommended to use ESB externally in a separate JVM when using this setup.
[1] http://wso2.com/library/articles/2013/03/configuring-wso2-esb-wso2-message-broker/
Regards,
Pubudu.

WSO2ESB 4.9.0 - OUT_ONLY not working for JMS endpoint

As per the documentation ESB as a JMS Producer setting OUT_ONLY should make the send mediator async. But instead I get timeout error as its waiting on response. What I found from various blogs is adding FORCE_SC_ACCEPTED would make it async. But in this case the proxy will respond at the send mediator. I do not want that, I want it to go to out sequence where I can generate a proper response message. Any help appreciated.
Use clone mediator :
in the 1st target, define OUT_ONLY property and use send mediator to send your message to a JMS queue
in the 2nd target, create a response message and use respond mediator

wso2:esb: What is the basic difference between call mediator and send mediator

Anybody would please through some light on difference between call and send mediator and what use cases these two mediators are used.
Send mediator - used to send messages out of Synapse to some endpoint. Then the response is returned to the OutSequence where you can send it back to the client
Use cases - When you only need to send a message to one back end and return the response back to the client.
Call mediator - Also used to send messages out of the Synapse to some endpoint, but the response does not come to the OutSequence. When we send a request using the call mediator, the response will arrive to the mediator that is placed right after the call mediator.So this will allow us to specify all the service invocations one after the other in a chain within a single sequence
Use cases - Service chaining. i.e.- Vehicle license renewal service
Another characteristic is that the callout mediator is blocking, send mediator and call mediator are not blocking. This answer is in regards to WSO2 versions until 4.8.0

WSO2 Aggregator in insequence

Will the aggregator mediator work in insequence ?
I have a splitter which will split the messages to JMS queue. I have another proxy service which should collect the messages and aggregate it.
I have kept the aggregator in insequence. Am I logically correct ?
Regards
Guru
#gnanagurus
Message aggregation cannot be done in the inSequence without having a iterate mediator placed in inSequence.
There is a correlation between the splitting and the aggregation.
You can only aggregate messages which are split using the iterate mediator or cloned using clone mediator within the same Proxy service.
If you can provide me more information on your scenario, I can help you further.

How to populate SOAP headers like From, ReplyTo in ESB 4.0.3

We are using WSO2 ESB 4.0.3 with Data services feature on MAC OSX 10.7.4.
I have proxy service which forwards the message to Data Service. When there is any fault in Data service the fault is returned to calling proxy service in OUTSEQUENCE. Now if there is any error I forward this to common error handler from proxy service which happens in OUTSEQUENCE. This common error handler is another proxy service only.
Now when the Error handling is completed the control returns back to original proxy service which called the error handling proxy service. But what happens is when the control returns to original proxy service from error handler it AGAIN starts executing the OUTSEQUENCE of proxy service.
So for me it is executing the OUTSEQUENCE of proxy service twice in case of fault from Data Service.
Is it standard behavior? I used to Java kind of executing where when the call from method returns it starts executing the next line. But here looks like it again starts executing the OUTSEQUENCE from beginning.
To avert executing the OUTSEQUENCE from beginning again I populate the value at "transport" scope in Error hanlder proxy which will used in filter mediator to avoid executing the logic in OUTSEQUENCE twice.
I am trying to find if there are any SOAP headers I can use instead of setting the property. I see no SOAP headers being set like "From" or "ReplyTo" and I believe message co-ordination happens with MessageId. How can we use these SOAP headers instead of property to divert the flow logic.
Please help.
thanks
Abhijit
In this case instead of using send mediator to invoke the web service you can use the call out mediator. Which makes a blocking call to error handling service and returns to the same place.
And also with esb 4.0.3 you can specify the receive sequence at the send mediator level. By default the response is received at the outsequence level.
eg. <send receive="fundTransferSequence">
<endpoint>
<address encoding="UTF-8" statistics="disable"
uri="http://10.1.23.11:8888/EgateValidWS/EgateValidWSSoapHttpPort" >
</address>
</endpoint>
</send>