Difference between BAM mediator and Mediation Statistics - wso2

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.

Related

Wso2 API Manager : API Produce and Consume JMS Messages

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.

loop back mediator and respond mediator

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.

Wso2 ESB and Bam: why operator name is always be "mediate"?

I'm now using WSO2 ESB for creating WebService Proxy and Bam for monitoring. I can seee the data in Bam explorer, but the payload_operation_name is always be "mediate".
How could I config to see the real name of the operation?
According to your description, I think you are using the Service Data Agent [1] to capture the proxy related statistics here where as you actually need to us the Mediation Data Agent for that. Because the Service Data Agent is mainly for statistics monitoring of the axis2 services, and hence you are getting the operation name as 'mediate' always when accessing the proxy service. The correct way to go forward is to use, Mediation Data Agent, but it will not publish the operation name what you are accessing, and if your backend services is axis2 service then you could use WSO2 Application server and use the Service Data Agent to collect the operation level stats of the web service. If your back end service is not within WSO2 servers, then you can use BAM mediator [3] or Publish Event Mediator (if ESB 4.9.0) [4] to publish this information to BAM.
[1] https://docs.wso2.com/display/BAM250/Setting+up+Service+Statistics+Data+Agent
[2] https://docs.wso2.com/display/BAM250/Setting+up+Mediation+Stat+Data+Agent
[3] https://docs.wso2.com/display/BAM250/Setting+up+BAM+Mediator
[4] https://docs.wso2.com/display/ESB490/Publish+Event+Mediator

How to monitor webmethod by using WSO2 BAM?

I have integrated WSO2 ESB and BAM. Greatly, I'm able to monitor the Service Proxy. But I wonder if there is anyway to monitor the operator/WebMethod of proxy. Please give me some advice.
I already use Bam mediator to collect ESB data for monitoring Webmethod. But my problem is there is not payload_request_count/response_count... data to sent to bam_service_data_publisher. Whereby the dashboard is always empty.
So how could I do to send those properties?
You can add the BAM mediator to a sequence (when adding a mediator, choose Agent -> BAM) and specify the BAM server profile and stream you want to use to start capturing and sending data events to the BAM server. Be sure to enable statistics on the sequence to start collecting the data.
https://docs.wso2.com/display/BAM250/Setting+up+BAM+Mediator
https://docs.wso2.com/display/ESB481/BAM+Mediator
In addition you can use Api Manager to control and monitor your web method.
http://wso2.com/api-management/

Use ActiveMQ as Event Broker in WSO2 ESB

In my wso2 esb 4.5.0-environment I want to send messages to ActiveMQ via the event mediator.
By default, the event mediator is connected to an internal, memorybased eventbroker in wso2 esb.
There is a possibility to change the event broker to WSO2 Message broker. This change is achieved by editing the file $wso2esb_home/repository/conf/event-broker.xml.
In the file there is an example config for WSO2 MB, but not for ActiveMQ.
What are the configuration settings for ActiveMQ as eventbroker?
We ended up solving this issue by developing a custom mediatior that communicates with ActiveMQ using JMS.