Payload in muleflow is getting converted in com.mulesoft.weave.reader.DefaultSeekableStream from org.glassfish.grizzly.utils.BufferInputStream. I am not sure why and due to this the subsequent activities (dw transformer) is failed. Anyone have any idea what could be the reason and how to overcome this.
The payload is pretty simple and I am trying to use two transformation activity, In first activity I parse the payload and create a flowVariable and in second transformation is to add values in payload. However, after first transformation the payload is changed to DefaultSeekableStream.
Thanks,
Abhi
Error message:
Related
I am getting some attributes in an API but all getting lost after an HTTP request connector in mule4.
why is it happening?
Look in the connector's configuration properties -> advanced tab for the connector configuration (in this case the HTTP connector's "request" operation) and you'll find a target variable and target value. If you fill in the target with a name - this does an enrichment to avoid overwriting the Mule message. If you leave it blank (the default) it will save the message (attributes, payload) over the top of the existing one - which is what you're seeing now. This mirrors the old mule 3 functionality, but sometimes you want it to leave what you have there alone.
So for the target value you get to pick exactly what gets saved.. If you want just payload: put that in. If you want both payload and attributes - I'd use "message" as that will mean you get both payload and attributes saved in the variable. Of course you may not want as much saved, so feel free to put in whatever dataweave expression you like - so you could even create something with bits from anywhere like:
{
statusCode: attributes.statusCode,
headers: attributes.headers,
payload: payload
}
A connector operation may replace the attributes with those of the operation. If you need to preserve the previous attributes you need to save them to a variable.
This is a default behaviour of MuleSoft. Whenever request crosses to transport barrier it losses existing attributes. You need to preserve attribute before HTTP Request.
I have Input.text file which has following values
**SNO|FIRSTNAME|LASTNAME|EMAIL|PHONE|ADDRESS|SELLING_DEALER**
**51|chris|clark|cpar#hotmail.com|0406-755789|Australia|MB MacGregor**
I have done some operation like phone validation or email validation.After performing that,need to write output file which has following values if phonevalidation gets successed.
**SNO|FIRSTNAME|LASTNAME|EMAIL|PHONE|ADDRESS|SELLING_DEALER|PHONEVALIDATION**
**51|chris|clark|cpar#hotmail.com|0406-755789|Australia|MB MacGregor|yes**
Otherwise(if phonevalidation gets failed)
**SNO|FIRSTNAME|LASTNAME|EMAIL|PHONE|ADDRESS|SELLING_DEALER|PHONEVALIDATION**
**51|chris|clark|cpar#hotmail.com|0406-755789|Australia|MB MacGregor|No**
Hope you understood my question!
Anyone please help me out to find solution,
Awaiting for your response
Try this. Depending on PHONEVALIDATION, you can route the payload using Router Mediator and later on enrich youy payload using Enrich Mediator.
How to enrich payload take a look this post (https://dzone.com/articles/wso2-esb-enrich-mediator-fast)
Hope this helps
I run some load tests (all endpoints) and we do have a known issue in our code: if multiple POST requests are sent in the same time we do get a duplicate error based on a timestamp field in our database.
All I want to do is to count timeouts (based on the message received "Service is not available. Request timeout") in a variable and accept this as a normal behavior (don't fail the tests).
For now I've added a Response Assertion for this (in order to keep the tests running) but I cannot tell if or how many timeout actually happen.
How can I count this?
Thank you
I would recommend doing this as follows:
Add JSR223 Listener to your Test Plan
Put the following code into "Script" area:
if (prev.getResponseDataAsString().contains('Service is not available. Request timeout')) {
prev.setSampleLabel('False negative')
}
That's it, if sampler will contain Service is not available. Request timeout in the response body - JMeter will change its title to False negative.
You can even mark it as passed by adding prev.setSuccessful(false) line to your script. See Apache Groovy - Why and How You Should Use It article fore more information on what else you can do with Groovy in JMeter tests
If you just need to find out the count based on the response message then you can save the performance results in a csv file using simple data writer (configure for csv only) and then filter csv based on the response message to get the required count. Or you can use Display only "errors" option to get all the errors and then filter out based on the expected error message.
If you need to find out at the runtime then you can use aggregate report listener and use "Errors" checkbox to get the count of failure but this will include other failures also.
But, if you need to get the count at the run time to use it later then it is a different case. I am assuming that it is not the case.
Thanks,
I am totally new to Parasoft virtualize. I created a virtual asset and added three fields in my data source correlation, My request xml has 4 fields. I am getting this error after processing the request.
<Reason>Failed to respond to incoming message using data source row correlation</Reason>
<Details>Values in incoming message did not match values in the data source "GetSubscriptionOperationsRequest"</Details>
Any suggestions on what might be the problem here?
The message which you are getting explains your problem.
The virtual asset cannot correlate your request with data in your data source to build response.
Try to send request with one of the values from column used for Datasource's corelation in your responder.
That value should be in request's filed used by correlation.
Maybe you should try to add catch all responder to see if you have correct corelation between incoming requests and your responder.
You can also ask Parasoft's technical support for help.
Is there a way in mule to extract parent flow message in sub/synchronous flow after sub message source has generated its message and modify it.Sub flow is having its own message source.
You can always get the message of parent flow in sub flow ..
Now extracting a message depends on its data type ...
For example if the payload type is xml and you need to extract particular value of a node, you can use XPATH...
Similarly for JSON payload there is different techniques of extracting it..
And now if you want the entire payload of parent flow and not just part of it, then you can always use #[message.payload] expression in subflow