WSO2 ESB 4.9.0 is taking time to invoke fault sequence - wso2-esb

When we are testing fault sequence in our flow, we noticed WSO2 is taking around 10seconds to invoke default fault sequence. Is this predictable behaviour in the product or I am missing something here.
Since the calling of default fault sequence is in the control of wso2 engine, we are not able to test it clearely. but we had out some logger before calling the nd point and logger at the entry of fault sequence and notices the time difference.
So the two logger statements have a gap of more than 10seconds. Would like to know what the wso2 engine doing here.

It would be helpful to provide a better explanation if you can share the error in the endpoint that you observe. Is there an error code? Based on what you have mentioned about the 10 seconds delay, this could be because of the callback processing interval. Please refer to http://blog.maheeka.me/2016/10/mocking-endpoint-behaviours-for.html for more details on this.

Related

Handle Bulk API load with MuleSoft

I am new to Mulesoft. I have an api in my application which can't handle more than 2000 parallel requests. I am thinking to use Mulesoft as a proxy API which takes the request and hit my API so that even if my API reaches its capacity Mulesoft will pause for sometime and hit my API without loosing any data.
Does Mulesoft solve my issue? if so can anyone please guide me through the process?
Thanks
You probably would want something as simple as the until-successful scope. You can read up more about that here. The premise of it is this:
You wrap a component in the until-successful scope, and you define the following:
What how a failure is defined or how a success is defined
How many times you want to try the component until an overall failure,
How much time should elapse between each call.
There are examples in the documentation that I linked to and those should help guide you!
What is peak load (no.of requests) your application API is expecting to handle ?
Mule API proxy can be used for response caching here. This means for similar reuests, your API wont get hit , the responses would be sent back from proxy itself. But this alone may not ,probably solve the load issue.
You might have to do the load balancing of your API depending on the peak load requirement.

How to handle time outs in WSO2 ESB 4.9.0

We are facing out of memory issues when lot of time outs happens with our back end service. Our application processes more than 300K transactions every day and some of our back end service times out when load is at it's peak. In this case, we have custom fault sequence initialized on API and custom fault sequence has respond mediator at the end to return the failed response to the client in case any time outs happens.
Our servers are going down and the heap dumps are pointing custom fault sequence.
Does anybody encountered this issue and also suggest us about best practices to implement custom fault sequence.

Mule outbound endpoint level statistics to facilitate integration testing

I am looking for a pragmatic solution to do Integration testing of our Integration tier based on Mule.
This article here has some excellent pointers about it, but looks a tad outdated. I am reproducing an excellent idea from the article here
Keeping track of the delivery of messages to external systems. Interrogating all the systems that have been contacted with test messages after the suite has run to ensure they all received what was expected would be too tedious to realize. How to keep track of these test messages? One option could be to run Mule ESB with its logging level set to DEBUG and analyze the message paths by tracking them with their correlation IDs. This is very possible. I decided to follow a simpler and coarser approach, which would give me enough certitude about what happened to the different messages I have sent. For this, I decided to leverage component routing statistics to ensure that the expected number of messages where routed to the expected endpoints (including error messages to error processing components). Of course, if two messages get cross-sent to wrong destinations, the count will not notice that. But this error would be caught anyway because each destination will complain about the error, hence raising the count of error messages processed.
Using this technique when I test my integration tier I will not have to stand up all the external systems and can test the integration tier in isolation which would be great.
#David Dassot has provided a reference implementation as well, however I think it was based on Mule 2.X and hence I cannot find the classes in the Mule 3.X codebase.
Looking around I did find FlowConstructStatistics but this is flow specific statistics and I am looking for endpoint specific statistics.
I do agree that as a work around we could wrap all outbound endpoints within sub-flows and get this working, but I would like to avoid doing this ...
Any techniques that help query the endpoint for the number of calls made, payload passed through the endpoints would be great!
First take a look to JMX, perhaps what you need is available right there.
Otherwise, if looging is not enough, and upgrading to the enterprise version is not ok for you. Give it a try to the endpoint level notifications.

Paging in Mule ESB

We have a Mule flow which processes a bunch of records. We want to implement paging because one of the steps in the process is calling an external system which can only take a set amount of records at a time.
We have attempted to solve this by adding a choice in the flow that checks if there are more records to process and if yes then call the same flow again (self reference the flow) but this caused stackoverflow errors.
We have also tried using the until-successful scope but we need errors to break out of the loop and be caught by the exception strategy.
Thanx
Mule possesses the ability to process messages in batches
http://www.mulesoft.org/documentation/display/current/Batch+Processing
It is the best option for your requirement.

How to get the number of exception the service has encountered in WCF?

How will I be able to count the number of exceptions thrown during the execution of a service?
Right now I'm using behaviors to hook with the dispatchers using IOperationInvoker and IParameterInspector. But I need to know how can i count the faults and exceptions that occurs in a particular operation or the total occurrence in the whole service.
A couple of approaches exist. You can use tracing (and inspect your log files); through instrumentation, that is, use performance counters to monitor faults on services or operations.
A nice way of achieving service monitoring is also available through AppFabric, if this is available to you.
HTH