Improved JSON Support of WSO2 ESB 4.8

24
Vanjikumar Sivajothy Senior Software Engineer Ishan Jayawardena Senior Software Engineer February 20 2014 WSO2 Advantage Webinar Improved JSON support of WSO2 ESB 4.8.0

description

 

Transcript of Improved JSON Support of WSO2 ESB 4.8

Page 1: Improved JSON Support of WSO2 ESB 4.8

Vanjikumar SivajothySenior Software Engineer

Ishan JayawardenaSenior Software Engineer

February 20 2014

WSO2 Advantage Webinar

Improved JSON support of WSO2 ESB 4.8.0

Page 2: Improved JSON Support of WSO2 ESB 4.8

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.

Page 3: Improved JSON Support of WSO2 ESB 4.8

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

Page 4: Improved JSON Support of WSO2 ESB 4.8

4

What WSO2 delivers

Page 5: Improved JSON Support of WSO2 ESB 4.8

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

Page 6: Improved JSON Support of WSO2 ESB 4.8

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

Page 7: Improved JSON Support of WSO2 ESB 4.8

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

Page 8: Improved JSON Support of WSO2 ESB 4.8

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

Page 9: Improved JSON Support of WSO2 ESB 4.8

9

Accessing JSON ContentAccessing Content of a JSON payload

๏ JSONPath

json-eval()

๏ XPath

Page 10: Improved JSON Support of WSO2 ESB 4.8

10

JSONPath Syntax

Page 11: Improved JSON Support of WSO2 ESB 4.8

11

CBR - JSONPath

๏ Filter Mediator

๏ Switch Mediator

Page 12: Improved JSON Support of WSO2 ESB 4.8

12

Payload Access - JSONPath

๏ Log Mediator

๏ Property Mediator

Page 13: Improved JSON Support of WSO2 ESB 4.8

13

Logging - JSON payload

๏ Log the entire payload using Log Mediator for JSON payload

๏ Full payload log in XML using Log Mediator

Page 14: Improved JSON Support of WSO2 ESB 4.8

14

Constructing JSON Payloads PayloadFactory Mediator

Well defined payload

Known structure for payload

Script Mediator

Recurring Structure like Array

Page 15: Improved JSON Support of WSO2 ESB 4.8

15

Constructing JSON - Payload

๏ The PayloadFactory mediator provides the simplest way to work with JSON payload

Page 16: Improved JSON Support of WSO2 ESB 4.8

16

Constructing JSON - Script

๏ The Script mediator provides the flexibility for handle recurring structures such as arrays

Page 17: Improved JSON Support of WSO2 ESB 4.8

17

Transforming JSON Payloads

๏ JSON to XML

๏ XML to JSON

Page 18: Improved JSON Support of WSO2 ESB 4.8

18

TroubleshootingDebugging using Carbon logs

๏ <ESB_HOME>/repository/conf/log4j.properties

Page 19: Improved JSON Support of WSO2 ESB 4.8

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/

Page 20: Improved JSON Support of WSO2 ESB 4.8

20

Questions?

Page 21: Improved JSON Support of WSO2 ESB 4.8

21

Business Model

Page 22: Improved JSON Support of WSO2 ESB 4.8

22

Page 23: Improved JSON Support of WSO2 ESB 4.8

23

Page 24: Improved JSON Support of WSO2 ESB 4.8

Contact us !