Wso2 API Manager : API Produce and Consume JMS Messages - wso2

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.

Related

Using local API endpoint for message processor issue

I'm trying to create a retry mechanism which will be recall my API (using POST method) in case of error (for example HTTP 400)
For this reason, I've created an In Memory Message Store. If my REST call is failed, I send the message to the message store that I created.
Then I tried to create an endpoint which is the same API URL (Scheduled Message Forwarding Processor will be used that) in WSO2 Management Console UI:
, but I've got the following error when I click the Test button:
Interesting thing is I can access the API with Postman or through my application but, WSO2 itself cannot access the API which is available on it.
I realized that when I click the test button, WSO2 adds ?wsdl at the end of the endpoint that I try and only available GET APIs can be recalled by message processor with this method but my API using POST method, and I need to recall it.
I'm using WSO EI 6.4.0
Thanks for any idea!
Regards.
For connection to REST API, you should use HTTP Endpoint, not the Address Endpoint
.
But you may consider extracting the logic you want from your API into a sequence and using the Message Sampling Processor to push messages to that sequence rather than your own REST API. This could be a more efficient solution.

How To Consume JMS Queue From WSO2 REST API

I am using WSO2 EI 6.1.1. I am trying to consume Active MQ queue from inside the WSO2 REST API, but unable to achieve it. I don't want to use the proxy service of WSO2. Please provide some input.
WSO2 provides the JMS connector. Can you try with this?

How to limit max connection allowed in WSO2 ESB?

I want to limit the number of connection received by WSO2 ESB. Is there any property to be able to limit by properties (axis2, carbon, etc.)?
This answer is based on the understanding gained from your comment. So, I assumed your backend has a limit of requests which can be processed which is less than what the ESB can accept.
There are two option:
Similar to catalina-server.xml for tomcat, there is pass-thru.properties file in the conf folder where you can tune certain parameters to suite the load you expect and also to match the capabilities of the VM you have hosted the ESB.
https://docs.wso2.com/display/ESB490/Configuring+passthru-http.properties
One disadvantage of above option would be, some of your requests will not be accepted by the ESB if its too busy. To overcome that, you can use a queueing mechanism. i.e. You accept all the requests and store them in a message store (a queue). Then configure a message processor to retrieve those messages and process. Disadvantage of this option is, its difficult to cater a request response scenario.
As Bhathiya has mentioned, you can front your ESB with a WSO2 API Manager and throttle the requests too.
Until ESB 4.8.1, it had throttling feature. You also can use Throttling Mediator in each service.
Another option is to front ESB by WSO2 API Manager which has complete throttling support.

How could bpmn service task send messages to WSO2 ESB in WSO2 BPS

I know a service task of BPMN can send messages (JMS or WS calls) to external system using camel or mule in Activiti, but it seems that there's no camel or mule supported in WSO2 BPS, and I'm afraid it is because WSO2 ESB can substitute for them. So, my question is how can a service task send messages to WSO2 EBS?
Obviously, I can create a Java class implementing JavaDelegate class for a service task and write some codes for sending messages in execute method, but I want to know whether there's some "smart" solution..
Thanks a lot.
BPMN service task would be the solution in this case as you have mentioned. What type of service call do you need to do in ESB? If it's a REST API invoke in ESB, you could use the REST TASK extension available in WSO2 BPS. You could find a good use case on this in example
For example, you could add a Service Task with Task Type: Java Class
Class Name: org.wso2.carbon.bpmn.extensions.rest.RESTTask
with following fields.
serviceURL - rest service endpoint
method - http method to use
basicAuthUsername - username if the endpoints are secured
basicAuthPassword - password for the username above
input - payload to be sent
outputVariable - process variable to save the response
header values in the format "key1:value1,key2:value2"

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/