Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
WSO2 Developers' Guide

You're reading from   WSO2 Developers' Guide SOA and data services with WSO2 Enterprise Integrator

Arrow left icon
Product type Paperback
Published in Sep 2017
Publisher Packt
ISBN-13 9781787288317
Length 368 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Authors (2):
Arrow left icon
Fidel Prieto Estrada Fidel Prieto Estrada
Author Profile Icon Fidel Prieto Estrada
Fidel Prieto Estrada
Ramón Garrido Ramón Garrido
Author Profile Icon Ramón Garrido
Ramón Garrido
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Getting Started with SOA and WSO2 FREE CHAPTER 2. Developing Integration Projects with WSO2EI Tooling 3. Building Web Services 4. Building Data Services 5. Transforming the Content of the Payload 6. Conditional Route 7. Quality of Service 8. Tasks Scheduling 9. WSO2 Enterprise Integration Logging 10. WSO2 Enterprise Integration Testing 11. Integrating with VFS 12. Integrating with JMS - WSO2 EI Message Brokering 13. Introduction to Ballerina

WSO2 EI Configuration

There are some configuration tasks that must usually be done when developing real-world services:

  • Configuring JDBC drivers
  • Configuring transports
  • Configuring message formatters and message builders

Configuring JDBC drivers

This is a mandatory configuration task when using data services. JDBC drivers allow WSO2 EI to connect to databases. By default, there are many JDBC drivers installed, so we have to configure the drivers' need for connecting the data sources that will provide us with the data in the orchestration.

We can do that with these simple steps:

  1. Locating the correct JDBC drivers for the databases that will play in our orchestration.
  2. Copying them to the <EI_HOME>/lib/ folder.
  3. Restarting the server.

Once the server is restarted, we will be able to connect to the databases.

Configuring transports

WSO2 EI supports several transports that we can use when building our services, such as the following:

  • JMS transport: This enables sending and receiving messages to queues and topics that implement the JMS specification
  • Mailto transport: This enables sending emails
  • VFS transport: Virtual File System (VFS) transport allows us to process files in a directory of the filesystem

We can enable this transport and many others in the <EI_HOME>/conf/axis2/axis2.xml file. All the transports available can be found in that file with a default configuration. We have to configure these transports for input and output connections. The input transports are configured using the transportReceiver XML tag, while the output transports are configured with the transportSender tag:

<transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/>

<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
<parameter name="myTopicConnectionFactory" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">conf/jndi.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter>
</parameter>

<parameter name="myQueueConnectionFactory" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">conf/jndi.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
</parameter>

<parameter name="default" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">conf/jndi.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
</parameter>
</transportReceiver>

Configuring message formatters and message builders

Message formatters and Message builders are the components that allow us to send and receive different types of messages according to the content type specified in the request. It is important to enable the content type used in the messages exchanged because if the content type received is not configured in the system, the message will not be understood.

Message builders are used to process incoming messages, and Message formatters are used to build the outgoing messages.

We can enable the Message formatters and builders in the file located in <EI_HOME>/conf/axis2/axis2.xml. Message formatters are under the same name in XML tag, and so are Message builders. Most values that messages content type can be received are already configured, but they are commented. We just have to find the one we need and uncomment it for Message formatters and/or message builders, depending on the case.

For example, to enable us to send and receive JSON messages, we have to enable that content type for input and output messages in axis2.xml:

<messageFormattercontentType="application/json" class="org.wso2.carbon.integrator.core.json.JsonStreamFormatter"/>

<messageBuildercontentType="application/json" class="org.wso2.carbon.integrator.core.json.JsonStreamBuilder"/>
You have been reading a chapter from
WSO2 Developers' Guide
Published in: Sep 2017
Publisher: Packt
ISBN-13: 9781787288317
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime