DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Slimming Down Your CDI Memory Footprint
  • Java EE 6 Pet Catalog with GlassFish and MySQL
  • Ultra-Fast Microservices: When MicroStream Meets Wildfly
  • Beans Custom Validation Constraints

Trending

  • What Is Good Database Design?
  • Agile Estimation: Techniques and Tips for Success
  • Build a Digital Collectibles Portal Using Flow and Cadence (Part 1)
  • API Design
  1. DZone
  2. Coding
  3. Java
  4. Getting started with SwitchYard 2.0.0.Alpha1 on WildFly 8.1.0.Final

Getting started with SwitchYard 2.0.0.Alpha1 on WildFly 8.1.0.Final

Markus Eisele user avatar by
Markus Eisele
·
Aug. 02, 14 · Interview
Like (0)
Save
Tweet
Share
3.59K Views

Join the DZone community and get the full member experience.

Join For Free

I've been sticking my head into some hot RedHat technologies lately and among the many interesting parts I found SwitchYard. Without being disrespectful towards everybody wrapping their heads around SOA and service oriented architectures in the past, this has always been kind of weird to me as a Java EE developer.

In the past I've been building component oriented applications with what I had at hand. Mostly driven by the features available in the Java EE standard to be "portable" and easy to use. Looking back this has been a perfect fit for many customers and applications. With an increasing demand for highly integrated applications which use already available services and processes from all over the place (departmental, central or even cloud services) this approach starts to feel more and more outdated. And this feel does not come from a technology perspective but from all the requirements around it. Having this in mind this post is the starting point of a series of how-to's and short tutorials which aim to showcase some more diverse ways of building (Java EE) applications that fit better into today's requirements and landscapes.

What is SwitchYard?
It is a component-based development framework for integration applications using the design principles and best practices of Service Oriented Architecture. If you're expecting kind of a full-blown fancy BPMN/SOA buzz-word suite you're off by a bit. This is for developers and should make it comparably straight forward to use. It's been around for a while now and starting with latest 2.0.0.Alpha1 it is compatible with WildFly 8. Reasons enough for me to get you excited about it.

Installing SwitchYard into latest WildFly 8.1.0.Final
Download both, the switchyard-2.0.0.Alpha1-wildfly bundle and WildFly 8.1.0.Final from the project websites. Install WildFly 8 by unzipping it into a folder of your choice (e.g. D:\wildfly-8.1.0.Final\). Now unzip the SwitchYard bundle into the WildFly folder. Depending on the zip utility in use, you may be prompted whether existing files should be replaced.  Answer yes/all for all files being unzipped.
It's an alpha so you have to tweak the configuration a bit because of SWITCHYARD-2158. Open "JBOSS_HOME/standalone/configuration/standalone.xml" and search for "org.switchyard.component.camel.atom.deploy.CamelRSSComponent" and change the package from "atom" to "rss". Now go ahead and start the server with "JBOSS_HOME/bin/standalone.sh/.bat".
If everything worked correctly you should see a message like this:

09:18:25,857 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.1.0.Final "Kenny" started in 3712ms - Started 210 of 259 services (81 services are lazy, passive or on-demand)


Building and Deploying the Bean Service Quickstart
If you want to get your hands dirty you can easily start with the packaged applications in the "JBOSS_HOME/quickstarts/" directory of the distribution. A simple one is the bean-service example. It makes use of one of the core components of SwitchYard, the Bean Component. It allows Java classes (or beans) to provide and consume services. And therefore you can implement a service by simply annotating a Java class or consume one by injecting a reference directly into your Java class.
And because the Bean Component is a standard CDI Extension, there is no need to learn a new programming model to use it. It's just a standard CDI Bean with a few more annotations.
For existing Java EE applications this means, that you can expose existing CDI-based beans in your application as services to the outside world or consume services within your bean by just adding some more annotations.
First things first. We need to tweak around a bit in the project pom.xml to make this work. Go to the build section and replace the "jboss-as-maven-plugin" with the latest version of the

<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>1.0.2.Final</version>

Now run "mvn package" to download all dependencies and execute the tests. It should just work fine and state:

Tests run: 6, Failures: 0, Errors: 0, Skipped: 0

Let's deploy it to our WildFly instance by issuing "mvn -Pdeploy install". The WildFly console finally lets you know about the successful execution:

10:19:44,636 INFO  [org.jboss.as.server] (management-handler-thread - 1) JBAS018559: Deployed "switchyard-bean-service.jar" (runtime-name : "switchyard-bean-service.jar")


Quick Test For The Application
A very quick test is to execute mvn exec:java which will execute the BeanClient class and fire a SOAP request towards the deployed service. The output should be:

SOAP Reply:
<soap:envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><env:header xmlns:env="http://www.w3.org/2003/05/soap-envelope"></env:header><soap:body><ord ers:submitorderresponse="" xmlns:orders="urn:switchyard-quickstart:bean-service:1.0
"><orderack><orderid>PO-19838-XYZ</orderid><accepted>true</accepted><status>Orde
r Accepted [intercepted]</status></orderack></ord></soap:body></soap:envelope>


That is it for today. The next parts will examine the sample application in a bit more detail and install the tooling and introduce you to various other components. If you can't wait, check out:

  • the SwitchYard Documentation which contains a whole bunch of useful stuff.
  • some awesome videos and learn all about SwitchYard in our new SwitchYard Video Series.
  • the other Quickstart applications. 
WildFly application Java EE

Published at DZone with permission of Markus Eisele, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Slimming Down Your CDI Memory Footprint
  • Java EE 6 Pet Catalog with GlassFish and MySQL
  • Ultra-Fast Microservices: When MicroStream Meets Wildfly
  • Beans Custom Validation Constraints

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: