Custom message builder to handle binary data - wso2 EI - wso2

1) I have an incoming message from IBM Legacy system, i need to convert it into XML/text and send it back to a client using WSO2 EI 6.1.1.
2) I am using apache kafka as a messaging queue here, hence i have created an inbound endpoint in wso2 EI.
3) I believe WSO2 EI by default doesn't have a binary builder, so i have written a custom message builder and added that JAR in EI_HOME/lib and added the message builder class in axis2.xml
4) I posted the binary message in to kafka topic, but still wso2 EI is not able to convert into desired format.
5) The message builder (logic) is working as a standalone java function and i can get expected response.
Any help to solve this issue would be appreciated.
Thanks

The content-type given in axis2.xml should match the content type given in kafka inbound endpoint.
the class path should be added in axis2.xml

Related

WSS Support in WSO2 API Manager

I am verifying the Websocket support in WSO2 API manager for one of my requirement. By default, WSO2 API Manager provides the options for configuring "WS" protocol and able to access it. But I couldn't find any configuration for "WSS" protocol support.
Is there any limitation in WSO2 API manager or is there any documentation available?
Thanks,
Sow
WebSocket support is available by default in WSO2 API Manager. Related transport configurations should be available inside the axis2.xml configuration file. You can find related documentation in the WSO2 API Manager documentation.
https://docs.wso2.com/display/AM260/Create+a+WebSocket+API
When using wss endpoint, we were able to observe some errors and we were able to get rid of the errors with the following approach.
Please include the following parameter in the SecureWebSocketInboundEndpoint.xml file which resides in the <APIM_HOME>/repository/deployment/server/synapse-configs/default/inbound-endpoints directory.
TLSv1.1,TLSv1.2
Also, please remove the following parameters from the same SecureWebSocketInboundEndpoint.xml file if the following parameters(wss.ssl.trust.store.file and wss.ssl.trust.store.pass) exist in the file.
repository/resources/security/client-truststore.jks
wso2carbon
Please use the following sample web socket client to try out and run the WSS client. Please change the variable carbonKeyStoreLocation to point to <API-M_HOME>/repository/resources/security/wso2carbon.jks. Note that port for the WSS API is 8099.
You can download the WSS client in the following WSO2 official documentation under the WSS Support section. (In the second step.)[1] Further please change the access token, web socket endpoint and the carbonKeyStoreLocation with your one to try out the scenario.
[1] https://docs.wso2.com/display/AM260/Create+a+WebSocket+API

Can WSO2 MB handle HTTP requests?

I've been working with WSO2 Message Broker in order to publish and consume messages through jms and other clients. I've gone through the official documentation including the samples.
What I want to know is that, is it possible for WSO2 MB to handle http requests directly instead of jms. Yes you can do something like this, by converting http to jms through WSO2 ESB which seems like a long process.
ie: I mean having http as the end point or the transport to publish and consume messages directly in WSO2 Message Broker.
In order to achieve this, you will have to use ESB + MB set up as explained at [1]. What you can do is to use ESB to wrap JMS functionality using a HTTP client. It is recommended to use ESB externally in a separate JVM when using this setup.
[1] http://wso2.com/library/articles/2013/03/configuring-wso2-esb-wso2-message-broker/
Regards,
Pubudu.

Can WSO2 API Manager send JMS messages to TIBCO EMS Server directly (No ESB in between)? How?

I'm trying to understand if and how is possible to send a JMS message to TIBCO EMS Server using WSO2 API Manager without using the WSO2 ESB in between.
The Pattern 1 of this article: http://wso2.com/library/articles/2015/10/article-how-to-enable-wso2-api-manager-to-work-as-a-jms-producer/ does something similar but for Apache ActiveMQ.
Is this possible? Any hint? Article?
Thanks in advance,
Gianfranco
EMS is a JMS provider like ActiveMQ.
The feature list mention : Maps between HTTP(s) and other protocols, such as JMS or writing to file systems.
You can ix the article you already have with JMS examples from the sample folder on a typical EMS installation.
I think the code will be mostly the same... but your are going to depend on jar provided inside the EMS installation.
You can follow the instructions here to configure the APIM[1] axis2.xml file.
As for placing the jars you need to do the following:
In the APIM_HOME/lib/endorsed folder delete the geronimo-jms_1.1_spec-1.1.0.wso2v1.jar
Add the jms-2.0.jar to the APIM_HOME/lib/endorsed folder
Add the tibjms.jar in the APIM_HOME/repository/components/libs folder.
[1] https://docs.wso2.com/display/Ei620/Configure+with+Tibco+EMS

Error message in wso2 dss

I'm using wso2 esb4.7.0 and wso2 dss 3.1.0.I have created a dataservice in dss and tested using try this service tool.It's working fine but when same dataservice is being fetch in esb using it's adress endpoint it showing following error -
ERROR {org.wso2.carbon.statistics.internal.ResponseTimeCalculator} - wso2statistics.request.received.time is null in the IN MessageContext
why so?is their any problem with esb?or it's internal problem?please let me know..
You have to set message headers using Header mediator. At least you have to set "To" and "Action" headers before you send payload to the data service. To get the write value of To and Action headers you can use Soap Tracer tool in monitor tab of WSO2-DSS management console. Run the tool, try the data service and refresh the tool to see the results of your trying. In the left side of the page of Soap Tracer tool you will see the To and Action, copy values from there and put them in header mediators you are using.

WSO2 - ESB server 4.7 Hangs- when an invalid json format is given as input for rest API

A REST API has been defined ESB. What we have observed is if the json format (invalid json),
the request is hanging and the server doesn't give any response. Ideally it should throw some
error at least and it should not hang.
I had the same situation in WSO2 4.8.1. Try to change JsonStreamBuilder in your axis2.xml to JsonBuilder from (org.apache.synapse.commons.json) or use your own implementation.