The team has been banging away on 0.6 and the end is nigh. Here's a quick look at the features available in 0.6 Beta1:
We started the typical Release Overview page for 0.6, but it's still a work in progress. Definitely check it out for more info and updates as we move closer to 0.6 Final over the next couple weeks.
SwitchYard had a good showing at both JUDCon and JBoss World this year. Our presentations were well received, feedback was tremendous, and all of our live demos worked. :-) If you weren't able to make it this year or you want a refresher, here's the collection of SY presos:
The Future of the Enterprise Service Bus at JBoss
Tom and I gave a talk on what we're up to with JBoss ESB and SwitchYard, where things are headed in the future, and tips on how to make the transition.
Enterprise Services Made Easy with SwitchYard
An introduction to SwitchYard with a healthy amount of show-and-tell.
An examination of the different elements of scaling an enterprise application (it's about more than runtime performance) and how SwitchYard can help.
The first two sessions were recorded via video camera and the last was recorded via screen capture. I haven't seen the videos posted yet by the production team, but hopefully that will go up soon. All three sessions had demos and cheesy jokes and it's just not the same if you can't watch/listen to those while looking at the slides.
The wheels managed to stay on the cart after a couple weeks in Beta so it's time to cut 0.5.0 Final. Key features for this release include a mammoth tooling upgrade with a visual application editor, support for declarative security policy, and a bunch of new gateway bindings. All told, there were 139 JIRAs resolved as part of this release, which I think makes it our biggest in the history of the project. Maven artifacts have been deployed, bits are up on the downloads page, and the documentation has been updated.
All the juicy details can be found in the SwitchYard 0.5 Release Overview, which contains a list of all the new features with pointers to examples, documentation, and such. Take a look and see what it's like to live large with SwitchYard.
Cheers,
The SwitchYard Team
0.5 Beta 1 bits have been posted to our Downloads page. There are 113 issues resolved in 0.5 (so far). I'm working on a revamped Getting Started guide and Release Overview for 0.5 Final, which should drop in a couple weeks. In the meantime, this is a great time to kick the tires and help us improve things for Final. Here are some useful links:
Lots and lots of stuff in this release, but I would have to say that our new visual application editor makes the biggest impact.
We've received some great feedback at JUDCon this week and we're looking forward to people trying the Beta build and giving feedback that we can fold into 0.5 Final and 0.6. So please get your hands dirty and let us know what you think!
This post provides a brief introduction to Switchyard, what it is, and how to use it to build a service-oriented application.
This post also provides a hands-on introduction to the new SwitchYard graphical editor. We’ll build an application from scratch, but our focus will be on the tools that SwitchYard provides you, and not on the business logic of our application.
(Please note, that this post was written with the "nightly" build of Switchyard 0.5 in June 2012. The eclipse based tooling introduced in this post will be released in version 0.5 of SwitchYard.)
The post is divided into 10 sections. Let’s get started in the first section with a question, actually a few questions.
Section 1: Starting with a few Questions
Just what is Switchyard? Is it another Enterprise Service Bus (ESB)? How can I use it? Better yet, why do I want to use it? And, did I mention that I’m in a hurry? Don’t waste my time - I’ll give you 15 minutes to get me the answers.
The top level page at http://www.jboss.org/SwitchYard defines SwitchYard as:
‘...a lightweight service delivery framework providing full life-cycle support for developing, deploying, and managing service-oriented applications...’
Hang on for a minute! That’s a pretty heavyweight sentence for a lightweight framework. Let’s dissect that sentence into smaller bites to see if we can better understand SwitchYard:
Section 2: What About JBoss ESB?
So far so good, but if we’re talking about a JBoss framework for SOA, aren’t we talking about JBossESB? Does SwitchYard mean that JBossESB is dead?
No, JBossESB is not dead. JBossESB is alive and well. A new update (version 4.11) scheduled for this week. The community is growing and as vibrant as ever. There’s even a beautifully written new Beginner’s Guide (http://www.packtpub.com/jboss-esb-beginners-guide/book). (Full disclosure, I’m one of the books authors.)
Well, if JBossESB is not going away, If I want to build a new SOA application starting today, should I use ESB or SwitchYard?
The answer to this question is, “it depends.”
At this point in time, SwitchYard is very much a work in progress. It’s design and implementation are evolving and will evolve significantly in the future months as it grows toward its 1.0 release. JBoss ESB is more mature, and is undergoing primarily incremental changes and improvements.
So, if you are building an SOA application that you want to go into production in the near future, you should look at JBoss ESB. Actually, if you need enterprise level support, you should really buy a subscription for the JBoss SOA Platform (http://www.redhat.com/products/jbossenterprisemiddleware/soa), which has at its core JBoss ESB.
For the longer term future, you should look at some of the ways in which SwitchYard will make some aspects of SOA application development easier.
Section 3: Making Your SOA Life Easier with SwitchYard
The primary ways in which SwitchYard differs from a traditional ESB highlight some of the ways in which SwitchYard can make SOA application services development easier:
Section 4: Visualizing SwitchYard?
It’s easy to visualize an ESB. You just think of a bus with services “plugged” into it. But what about SwitchYard. What does SwitchYard “look like?”
An ESB, and in this context, SwitchYard is an ESB, is really a means to an end. It’s a tool for creating service-oriented applications. To create a service-oriented application you look inward at your application architecture, not outward at the runtime architecture of the bus. Your concern and your focus in on the application that you’re building and not on the runtime and tooling. SwitchYard is the tooling and runtime for your service-oriented applications.
It’s a little more difficult to draw a picture of SwitchYard, as one of its main goals is to enable you to focus on what your application looks like!
The contents of a SwitchYard project however do have a different configuration than JBoss ESB project. We’ll take a look at these differences next.
Section 5: Anatomy of a SwitchYard Project Configuration
Unlike traditional ESBs, the configuration requirements imposed by SwitchYard are minimal. Let’s use JBossESB as reference point. A service-based application deployed to JBossESB requires configuration files to define the JMS topics and queues on which it depends. It also requires a “jboss-esb.xml” file to define the resource providers (such as JMS) on which the services depend, the services themselves, the gateways through which messages are “on-boarded” to the ESB and the notifiers through which messages are sent off of the ESB, and the “pipeline” of actions that perform the tasks that comprise the services. Creating and maintaining a jboss-esb.xml file for a services-based application can be a difficult and time-consuming task.
A SwitchYard application has two primary configuration files:
At first glace, this may seem like a trivial change from jboss-esb.xml to switchyard.xml. What’s the big deal, only the file name changed, right?
The major difference is that the elements defined in switchyard.xml conform to the OASIS Service Component Architecture Assembly Model Specification (http://docs.oasis-open.org/opencsa/sca-assembly/sca-assembly-spec-v1.1.html). The Service Component Architecture (SCA) model provides standards for building SOA applications.
Why was this standard selected as the lingua franca of SwitchYard configuration? What advantages does using this standard give us? There are multiple levels of advantages:
It’s also important (as we’re all lazy programmers who want to avoid error-prone manual tasks, after all) that SwitchYard provides tools to automatically populate the contents of switchyard.xml. We’ll see these tools in action in a bit.
Section 6: Services
When we talk about SwitchYard services, we're concerned with how we can create a service, and then how that service can be used (or "consumed") by other services.
How exactly do you create a SwitchYard service? Watch closely because SwitchYard makes this simple:
And that’s all folks. You’ve got a service. Yeah, SwitchYard tries to keep this simple.
Here’s an example (thanks to Keith Babo - as I’m borrowing this code from his demo):
1) Start with a POJO:
public interface OrderService {
OrderAck submitOrder(Order order);
}
2) Create an interface:
public class OrderServiceBean implements OrderService {
public OrderAck submitOrder(Order order) {
...
}
}
3) Annotate the POJO - and it’s a service!
@Service(OrderService.class)
public class OrderServiceBean implements OrderService {
public OrderAck submitOrder(Order order) {
...
}
}
Once you have a service, how do you access/consume it? Through Context Dependency Injection (CDI) in three more steps:
(1) Add an @Reference and @Inject annotation
(2) Add a field representing the consumed service
(3) Invoke methods on the injected reference
@Service(OrderService.class)
public class OrderServiceBean implements OrderService {
@Inject @Reference (1)
private InventoryService inventory; (2)
public OrderAck submitOrder(Order order) {
Item orderItem = inventory.lookupItem(order.getItemId()); (3)
…
}}
What types of services does Switchard support?
At this point, let’s switch into to a hands on mode and perform some tasks with SwitchYard.
Section 8: Getting SwitchYard
When I first started working with JBoss software, I asked a co-worker, how do I perform an installation? His response was a blank stare for a few seconds, after which he said, “You download the .zip and unzip it.”
It might sound trivial, or obvious, but the ease, and low entry cost (you can’t get cheaper than free!) with which you can get started using JBoss projects is a great feature. You can download whatever projects you want and try them out at no cost.
To get a copy of SwitchYard, the steps you have to do are:
Go to this page: http://www.jboss.org/SwitchYard/downloads - you’ll see a display similar to this:
Your download choices are:
For the purposes of this impatient discussion, we’ll use the SwitchYard AS7 Distribution.
Section 9: Running SwitchYard and the JBoss AS7 Server
The JBoss AS7 (http://www.jboss.org/as7) server is JBoss’ newest application server release. AS7 is compliant with the Java Enterprise Edition 6 specification, and is the preferred deployment platform for SwitchYard.
(Note that by the time you read this, SwitchYard 0.5 will probably be available as a download.)
To install the SwitchYard AS7 Distribution, simply select a directory where you want to run the server, and unzip the http://downloads.jboss.org/switchyard/releases/v0.4.Final/switchyard-as7-0.4.0.Final.zip file into that directory.
In this post, we’ll use the /opt/SwitchYard directory:
mkdir /opt/SwitchYard
cd /opt/SwitchYard
unzip switchyard-as7-0.4.0.Final.zip
Let’s jump right in and start up the server:
cd switchyard-as7-0.4.0.Final/bin
sh ./standalone.sh
After a very short time (Did I mention how fast JBoss AS7 is? It starts up and runs very quickly!), you’ll see logging messages that look like this that indicate the server is up and running:
23:05:13,608 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-3) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080
23:05:13,718 INFO [org.jboss.as.connector] (MSC service thread 1-5) Starting JCA Subsystem (JBoss IronJacamar 1.0.3.Final)
23:05:13,775 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) Bound data source [java:jboss/datasources/ExampleDS]
23:05:14,173 INFO [org.jboss.as.deployment] (MSC service thread 1-2) Started FileSystemDeploymentService for directory /opt/local/SwitchYard/SwitchYard-as7-0.3/standalone/deployments
23:05:14,192 INFO [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.2.Final "Arc" started in 2137ms - Started 97 of 152 services (55 services are passive or on-demand)
Section 10: Creating a New SwitchYard Project From Scratch
Now that we have SwitchYard running, let’s create a new project. We’ll do this the easy way and take advantage of some new JBoss eclipse-based tooling, the SwitchYard Graphical Editor. Note that as of this writing, the editor has not been released. It will be released in SwitchYard 0.5
First, we need to install a few things:
Once all the tools are in place, we can create a new SwitchYard project. Before we do that, however, let’s think about the application that we want to build, and the steps that we have to perform.
The application exposes a simple web service implemented in a Java bean. The service accepts a string, and prefixes the world “hello” to it. That’s right, if we pass the word “world” to the service, it returns “hello world.” We’ll access the service by sending it a SOAP message. For our “client,” we’ll use soapUI (http://www.soapui.org/).
The function performed by the application is not the important thing. What’s important is how you can build it with the SwitchYard tooling, especially the new SwitchYard graphical editor.
The major steps that we’ll perform are:
OK, let’s begin!
Note: This article was originally written in July 2012. The following sections are an update to the article using the latest release (0.7) of SwitchYard as of March 2013. The UI has changed and improved a great deal since July 2012. The screenshots that are used in the following sections reflect the current (0.7) UI.
The steps that we'll follow are:
Let's take these steps one-by-one:
Create a new SwitchYard project
To create a new SwitchYard project, select File->New->Project->SwitchYard->SwitchYard Project
We can accept most of the default settings for this project, the exception being that we have to set the bean and SOAP facets:
When the new project wizard completes, we access the new SwitchYard graphical editor by double-clicking on the SwitchYard icon in the project explorer:
And the editor is opened.
The editor consists of:
Create a bean component, and in the course of doing so, create its contract (interface)
To create a new bean component, select the Bean implementation icon from the palette and drag it onto the canvas. The Bean definition dialog opens:
To create the corresponding contract (interface) click on the blue "Interface:" text and this dialog opens:
After we select "Finish" to save the definition, we see the bean component on the canvas:
Fill in the business logic of the bean and the details of the contract (interface)
At this point, we need to fill in the code for the bean and its interface:
Promote the service so that it is visible as a web service, and in the course of doing so generate the service's WSDL, and create the necessary transformations
Next, we promote the service to make it visible (right-click on the service's green icon):
We want to make the service visible as a web service, so we'll select WSDL as the interface type - and the UI will generate a WSDL for us, based on the contract (interface) that we defined earlier:
Note that we selected to not use wrapped messages, so that our transformations can access only what is inside the elements they receive.
Our service has to transform data between objects and strings, so we next have to generate transformations:
Our (Java) transformers are quite simple:
We're almost done!
Create a SOAP binding
Now, we create a SOAP binding:
Note that you can always view/edit the binding after it's created by accessing its properties:
OK. It’s time for action. Let’s deploy our application:
And fire up soapUI, we can easily create a request by accessing the deployed service’s WSDL:
http://localhost:8080/switchyard-example1/HelloService?wsdl
http://127.0.0.1:18001/switchyard-example/HelloService?wsdl
And there it is, the output from our very small SwitchYard service.
Section 11: What’s Next?
Well, that’s a brief (impatient) introduction to Switchyard, where to get it, how to install it, and how to build a service from the bottom up. What’s next? In a followup post, we’ll take an in-depth look at the services Switchyard provides by examining some of the SwitchYard quickstarts in detail.
There are a number of great demos of SwitchYard available at the SwitchYard video channel - check it out! https://community.jboss.org/wiki/SwitchYardVideoSeries
Acknowledgements
I’d like to thank Keith Babo, Tom Cunningham, Rob Cernich, and Brian Fitzpatrick for their (never impatient) review comments and suggestions on writing this post!
The SwitchYard team has been hard at work in the 0.5 release crafting some cool Eclipse-based tooling for creating SwitchYard applications. The goal of the tooling is twofold:
We still have a ways to go, but I think what's there now is quite impressive. Here's a quick video I put together showcasing some of the features being worked on. Do your eyes a favor and watch it expanded in HD and not embedded.
As always, we would love to hear your feedback. Swing by the forums and let us know what you think.
In SwitchYard 0.5, a new and convenient way to map variables into and out of your jBPM processes has been introduced. The same goes for mapping variables into Drools globals. This is done by leveraging the MVEL expression language. Via XML or Java annotations, you can easily navigate your SwitchYard Exchange, Context or Message objects and pull out the data you want to set into your process or rules.
Here's a quick example using XML (you can also use the @Mapping annotation):
<implementation.bpm> <parameters> <mapping expression="context['org.switchyard.messageId']" variable="messageId"/> </parameters> <results> <mapping expression="message.content" variable="payload"/> </results> </implementation.bpm>
And here's one using annotations (you can also use the <mapping/> element):
@Rules(globals={ @Mapping(expression="exchange.serviceName.localPart", variable="service") })
To learn more and see more complete examples, please refer to the Mapping Parameter/Result Variables section of the BPM Services documentation, as well as the Mapping Global Variables section of the Rules Services documentation.
Enjoy!
A few updates on the Forge front.
First, after an overly long stay on Forge Beta 3, we have upgraded our Forge support to 1.0.2.Final. This also happens to bring us up to the current support level for Forge within JBoss Tools. If you haven't tried out the Forge Console in JBDS yet, give it a shot. You get the best of both worlds - quick bootstrap with Forge and powerful edit/build/debug support in Eclipse all in one package. Forge 1.0.2.Final can be downloaded from the Forge docs page and our latest installer for the SwitchYard plugins can be found in the latest nightly build.
I also wanted to take a moment to thank Mario Antollini for his recent contributions to our Forge tooling. He added two new commands for creating service references for an existing service implementation - a general command (add-reference) which updates the switchyard.xml and a specific command for CDI bean services (bean-reference). This comes off pretty nicely considering you can go from nothing to a service implementation with a dependency on another service in two commands:
bean-service create --serviceName OrderService bean-reference create --beanName OrderService --referenceName InventoryService
Gets you this:
@Service(OrderService.class) public class OrderServiceBean implements org.example.OrderService { @Override public void process(String content) { // Add processing logic here } @Inject private @Reference("InventoryService") InventoryService inventory; }
None too shabby.
If you're interested in learning a bit more about the foundation for our runtime governance support in SwitchYard, check out this video:
This is the first video we've recorded in 1920x1200, so please let us know if there's an issue with the resolution. As always, viewing the HD version of the video is recommended.
One of the primary themes for our 0.4 release was governance and how we can support common governance capabilities at both design-time and runtime. Governance is an incredibly broad domain, so we started with the basics. In the case of design-time governance, this meant exploring the workflow and capabilities a user might want for interacting with a service repository. The details are covered in the docs, but I find that seeing things in action is the best way to learn. I have created a screencast based on our Repository Integration example, so if you like to see before you do, then here ya go.
BTW, I recommend watching the video in HD full-screen vs. embedded. Both flavors included below.
This is just the tip of the iceberg in our overall SOA governance support. If you want to see where things will go from here, check out the Overlord project.
We took a little extra time with this one, but it was worth it. A primary theme of 0.4 was how the ESB can be used in the context of governance, at design-time and runtime. We're really happy with the progress we've made there and we're just getting warmed up. In total, there were 105 JIRAs resolved in 0.4, so there's plenty in there beyond governance as well. The juicy details can be found in the SwitchYard 0.4 Release Overview, which contains a list of all the new features with pointers to examples and documentation on each.
We have a sizeable backlog of videos we've been planning on everything from getting stuff installed, to feature profiles, to exploration of the more obscure aspects of the project. So stay tuned and let us know what you think!
Cheers,
The SwitchYard Team
SwitchYard 0.4 is almost out the door, and with it comes a brand-spankin' new API for BPM task integration!
Whereas the underlying BPM implementation is jBPM 5.2.0.Final, the API wraps it with SwitchYard interfaces. How easy is it to use these interfaces?
Here's the minimal code for starting a TaskServer (host/port is overridable):
TaskServer server = TaskService.instance().newTaskServer();
server.start();
And the minimal code for connecting a TaskClient (host/port is overridable):
TaskClient client = TaskService.instance().newTaskClient();
client.connect();
How about getting, claiming, starting and completing a Task?
String userId = "david";
List<String> groupIds = Arrays.asList(new String[]{"users"});
Task task = client.getTasksAssignedAsPotentialOwner(userId, gropuIds).iterator().next();
client.claim(task.getId(), userId, groupIds);
client.start(task.getId(), userId);
client.complete(task.getId(), userId, null);
Make sure you check out the links below for more detailed information:
And of course we are always available in the SwitchYard Forums or #switchyard on freenode.
Enjoy!
The good folks at mastertheboss.com have put up a brief interview with the SwitchYard team here:
http://www.mastertheboss.com/jboss-application-server/371-introducing-switchyard.html
Expect to see a lot more content rolling out as we are wrapping up 0.4. We dropped CR1 last week and Final will be out next week.
Just got back home from JUDCon India 2012 and all I can say is "Wow!". Magesh and I gave a talk on SwitchYard and I also had a chance to participate in the developer panel at the end of day 1. The entire trip was a fantastic experience, albeit a bit short. I just checked and I spent about 49 hours traveling to and from India and only 72 hours in the country itself! Here are my highlights of the trip:
All of the talks will be available for download and video will be available as well.
Is it auspicious to say that SwitchYard now uses "Flux Capacitor"? Well, yes! Because that is the code name of JBoss AS 7.1.0.CR1. The nightly builds of SwitchYard now uses Flux Capacitor. How cool is that? You can download the nightlies from here:
SwitchYard Team!