improved json support of wso2 esb 4.8
DESCRIPTION
TRANSCRIPT
Vanjikumar SivajothySenior Software Engineer
Ishan JayawardenaSenior Software Engineer
February 20 2014
WSO2 Advantage Webinar
Improved JSON support of WSO2 ESB 4.8.0
2
About the PresentersVanjikumar Sivajothy [email protected]
Senior Software Engineer
Vanji joined WSO2 in February 2013. He is a Senior Software Engineer in the WSO2 Enterprise Service Bus product team. In addition to his product development efforts he has also provided technology consulting on customer engagements, including development service programs.
Ishan Jayawardena [email protected]
Senior Software Engineer
Ishan joined WSO2 in December 2011. He is a software engineer in the integration technologies team where he mainly focuses on the WSO2 Enterprise Service Bus. In addition to his product development efforts he has also provided technology consulting on customer engagements, including customer QuickStart programs focused on Enterprise Application Integration projects.
3
About WSO2๏ Global enterprise, founded in 2005
by acknowledged leaders in XML, web services technologies, standards and open source
๏ Provides only open source platform-as-a-service for private, public and hybrid cloud deployments
๏ All WSO2 products are 100% open source and released under the Apache License Version 2.0.
๏ Is an Active Member of OASIS, Cloud Security Alliance, OSGi Alliance, AMQP Working Group, OpenID Foundation and W3C.
๏ Driven by Innovation
๏ Launched first open source API Management solution in 2012
๏ Launched App Factory in 2Q 2013
๏ Launched Enterprise Store and first open source Mobile solution in 4Q 2013
๏ Generated 2x revenue growth in 2013 and 2012
๏ Captured 65 new customers in 2013
๏ Obtained $20 M of funding from CISCO and Toba Capital
4
What WSO2 delivers
Agenda
5
JSON
JSON Support of WSO2 ESB 4.8.0
Developing JSON aware message flows with ESB 4.8.0
Accessing content of JSON messages
Content Based Routing (CBR) for JSON messages
Constructing, and Transforming JSON
Logging, and Troubleshooting
6
JSONA data interchange format that is,
๏ Lightweight
๏ Text-based
๏ Language independent
๏ Human/machine readable
A better data interchange format
JSON and JavaScript
Internet Media type
๏ application/json
7
JSON Support of WSO2 ESBMessage Builders, and Message Formatters
๏ Builder, Formatter
Register builder formatter in ESB_HOME/repository/conf/axis2/axis2.xml
<messageBuilder contentType="application/json" class="org.apache.synapse.commons.json.JsonStreamBuilder"/>
<messageFormatter contentType="application/json" class="org.apache.synapse.commons.json.JsonStreamFormatter"/>
๏ StAXON
๏ Deferred Building
๏ Efficient
8
JSON Support of WSO2 ESBJSONPath
๏ Log, Property, Switch, Filter
PayloadFactory, Script Mediators
๏ Construct, transform JSON
Convert between JSON and XML
<property name="messageType" value="application/json" scope="axis2"/>
<property name="messageType" value="application/xml" scope="axis2"/>
Better XML representation of JSON requests
๏ Minimum information loss
๏ Supports complex JSON structures
๏ Supports special characters
Documentation
http://docs.wso2.org/display/ESB481/JSON+Support
9
Accessing JSON ContentAccessing Content of a JSON payload
๏ JSONPath
json-eval()
๏ XPath
10
JSONPath Syntax
11
CBR - JSONPath
๏ Filter Mediator
๏ Switch Mediator
12
Payload Access - JSONPath
๏ Log Mediator
๏ Property Mediator
13
Logging - JSON payload
๏ Log the entire payload using Log Mediator for JSON payload
๏ Full payload log in XML using Log Mediator
14
Constructing JSON Payloads PayloadFactory Mediator
Well defined payload
Known structure for payload
Script Mediator
Recurring Structure like Array
15
Constructing JSON - Payload
๏ The PayloadFactory mediator provides the simplest way to work with JSON payload
16
Constructing JSON - Script
๏ The Script mediator provides the flexibility for handle recurring structures such as arrays
17
Transforming JSON Payloads
๏ JSON to XML
๏ XML to JSON
18
TroubleshootingDebugging using Carbon logs
๏ <ESB_HOME>/repository/conf/log4j.properties
19
Call to Action
Download WSO2 ESB
http://wso2.com/products/enterprise-service-bus/
ESB Product Documentation
http://docs.wso2.org/display/ESB481/WSO2+Enterprise+Service+Bus+Documentation
Articles On REST RESTful Integration with WSO2 ESB
http://wso2.com/library/articles/2013/12/restful-integration-with-wso2-esb/
20
Questions?
21
Business Model
22
23
Contact us !