Skip to content

Tutorial

Ryan Boykin edited this page Jul 4, 2018 · 11 revisions

Note: This is a current work in progress, and incomplete.

Introduction

In this project, I set out to create a database connected REST application using Wildfly and switchyard. I found online resources on how to do this to be lacking, especially regarding the sql bindings, so I set out to figure it out and document it in this tutorial. I first created a REST API with no database connections, then integrated that with the switchyard sql bindings, when I found the sql bindings to be inadequate I decided to use a more traditional Java MySql connector method.

Resources

Wildfly

Wildfly is available from http://wildfly.org/downloads/ for development use, the enterprise level is available as JBoss EAP with support from Redhat.

Switchyard

The switchyard component framework is available as a module for Wildfly or JBoss via http://switchyard.jboss.org/downloads/.

Credits

Several resources were used in figuring out how to make this work, I feel it necessary to cite these.

  1. Gary Liu published a youtube video and a blog post that was instrumental in figuring out the REST bindings.

REST API Binding

There are decent tutorials available on connecting REST binding to Switchyard. I intend to expand on these in areas that I found them lacking.

SQL Connector Module

The only resource I found related to creating a SQL binding for switchyard was the quickstart included with the Switchyard download. This resource provided a method to do periodic polling for a "SELECT" query and a method to perform an "INSERT" and "DELETE". There is currently no example of performing an "UPDATE" or any query that requires providing more than one object.

SQL Binding

SQL Connector

REST Client

Conclusion