I am working on WSO2 ESB 4.9.0. We have an API with in and out sequences. All the business logic is there in, in sequence and out sequence doesn't have any logic implemented. Some times we need to exit the flow from in sequence because all our back end service calls are made with call mediator and not with send mediator. In this service chain pattern, if we want to exit the flow, do we need to use respond OR loopback mediator.
Can somebody help me what are the basic use cases where loopback and respond can be used
respond mediator will send back the response to the client. loopback mediator will move the message flow to the outsequence. In this case you need to use respond mediator since you need to exit the flow and respond to the client. However, if you have any mediation that you need to execute in outsequence, you can always use loopback mediator and use respond mediator in the outsequence to do the same.
Related
Scenario
I have configured the API in WSO2 which connects to my back-end HTTP service.
Before calling my back-end service, I want to call another HTTP end point (XML over HTTP) to perform some validations. If the validation response is success then the back end point configured in the API gateway can be invoked else the API needs to return error. Please let me know how this can be achieved.
Thanks,
Karthi
You can add a custom in sequence in your API https://docs.wso2.com/display/AM260/Adding+Mediation+Extensions and handle that particular logic there.
In the In sequence, you can add a call mediator https://docs.wso2.com/display/EI660/Call+Mediator to call the Back end and following that you may add a filter mediator https://docs.wso2.com/display/EI660/Filter+Mediator and validate the response and proceed the mediation flow based on it.
In the filter mediator, you may implement a logic to respond back from there itself if it is an error else do nothing so that it will proceed and call you API back end.
I have a situation here where as I need to create a API flow such as below.
I manage to create an API using the GET method and Call Mediator for the login request. However, when i change the API method to POST (because I need to send something in the body) and using Call Mediator for the Login request, it prompt me an error.
I am not sure whether POST method API is not allowed to be using together with the Call Mediator or not.
Is the flow I want to create above, is achievable just using API or do i need to create a Business Process Management Project?
If I wanna use POST method together with Send Mediator, how would it be ? I was aware that I can not put any mediator after the Send Mediator
Any advice would be grateful. Thank you again.
What is the error that you got? and Try removing REST_URL_POSTFIX property before calling to your endpoint.
<property name="REST_URL_POSTFIX" action="remove" scope="axis2"/>
I have following requirement, is this possible to achieve in WSo2 API Manager. Please advise. I got few article/pages with information on how to post request to message queue but none for how to consume message.
UI client calls a REST API exposed on the API gateway.
The backend service actually providing the implementation is a module
This module reads from a MQSeries queue an XML message, processes it and responds back to an outgoing queue.
So API gateway must be able to transform the REST/JSON payload to an XML payload and put it on the MQ Series queue
Wait synchronously and pick up response from another MQSeries queue.
APIM does not support consuming JMS messages OOTB. But WSO2 ESB. See https://docs.wso2.com/display/ESB500/ESB+as+a+JMS+Consumer
However, since APIM has ESB features installed by default, you should be able to deploy such a JMS consuming proxy in APIM too.
Have a try and post if you face any issues.
I am facing an alarming situation with the services published in WSO2 ESB. In an absolutely random way, some services fail the response message validation, in spite of the fact that de response is totally correct. The error deals with missed tagges in the payload. This takes place with no pattern at all. A services is working until it starts to respond a validation fault. When this occurs, I check the following:
A soapUI client can be generated by the WSDL published by the ESB, so it is not a reference issue.
Response is validated successfully by the XSD used by the validate mediator. (validated by an alternative tool).
I can even see the payload that previously is logged and it is correct. This have occured several times in different services.
The only way to fix this is undeploy the services and deploy it again. I have try the redeploy option in the service dashboard, and reset the whole system with no success.
I have a feeling that somehow the payload used by the validate mediator is a kind of locked, blank, unreachable or dirty.
How can I set the validate mediator process in debug mode? I think this might help.
Any help? I am thinking of denying using this system in a production environment.
I use wso2 esb 4.5.1.
King regards.
Put the log mediator with the log level ="full" before the validate mediator and see, what is passed to the validate mediator. This will help you to find the erroneous response..
Why there are two different data agents, BAM mediator and Mediation Statistics available for ESB? What are the differences and similarities in each of them?
Mediation Statistics data agent is used to send accumulated statistics of mediation in ESB to the BAM. It sends events to BAM periodically.
But BAM mediator is different. It can be defined any location as a mediator in a mediation sequence of ESB. Even multiple times. Each BAM mediator can independently send events to the BAM side via the defined stream. And also BAM mediator sends events each time a message is passed through the BAM mediator.