The Administration Guide contains information on how to deploy, configure, and manage the SwitchYard runtime.
Deployment
Packaging
SwitchYard supports the following packaging types for deployment:
-
JAR : the default packaging type for SY apps
-
WAR : useful when you want to include additional libraries with your application and/or you have web application resources (e.g. JSPs, JSF, etc.).
-
EAR : supports multiple application modules in a single deployment along with additional libraries.
For an example of packaging as a WAR, check out the helpdesk quickstart. Pay particular attention to the configuration of the maven-war-plugin to include the SY descriptor and exclude dependencies in the WEB-INF/lib directory which are already available in the SwitchYard runtime.
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<packagingExcludes>
WEB-INF/lib/*.jar,
WEB-INF/classes/META-INF/switchyard.xml
</packagingExcludes>
<webResources>
<resource>
<directory>target/classes/META-INF</directory>
<targetPath>WEB-INF</targetPath>
<includes>
<include>switchyard.xml</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
EAR deployments allow multiple SwitchYard applications to be included in a single deployable archive. Keep in mind that the SY applications included in an EAR are still considered separate applications from a lifecycle and visibility (both class loading and service) standpoint. For an example of deploying a SwitchYard application as an EAR, check out ear-deployment quickstart.
Management Console
Overview
The SwitchYard management console is integrated with the standard JBoss AS management console and provides the following:
-
A view of the applications and services deployed on the server.
-
A view of various execution metrics.
-
A view of the SwitchYard subsystem configuration.
SwitchYard contributes views to the standard JBoss AS management console's Runtime and Profile pages.
Metrics Views
SwitchYard Message Metrics can be accessed on the Runtime page of the AS console under Status -> Subsystems -> SwitchYard. This page provides a view of a comprehensive set of metrics aggregated at various levels within the system.
The following types of metrics are available:
-
Message count: total, success, failed
-
Processing time: total, min., avg., max.
Collected metrics can be viewed at the following levels:
-
System : metrics for the entire SwitchYard runtime (all deployed applications)
-
Service : metrics for a composite service in an application. Additional metric details are provided for the following:
-
Gateway: metrics for each binding on the service (e.g. FTP metrics for service "ABC")
-
Operation: metrics for each operation on the service
-
Service Reference : metrics for references invoked by the service
-
Reference : metrics for a composite reference in an application. Additional metric details are provided for the following
This page also provides the user with the ability to reset metrics at various levels.
Application Views
SwitchYard contributes a page to the Runtime Operations section which provides views detailing various aspects of SwitchYard applications running on the system. These views may be accessed on the Runtime page of the AS console by selecting Runtime Operations -> SwitchYard. The following views are provided:
-
Applications: lists all SwitchYard applications deployed on the server
-
Services: lists all Services provided by the applications deployed on the server
-
References: lists all service References used by applications deployed on the server
-
Artifacts: lists all artifacts referenced by applications deployed on the server
Applications
The main Applications tab displays all the applications deployed on the server. Selecting a particular application in the list will populate the Application Details section below the list. The following details are provided:
-
Services: services provided by the application. Selecting a service will open the main Services tab, displaying details for the service.
-
References: services used by the application. Selecting a reference will open the main References tab, displaying details for the reference.
-
Properties: properties defined in the application. The properties may also be edited within this view.
-
Artifacts: artifacts referenced by the application. Selecting an artifact will open the main Artifacts tab, displaying details for the artifact.
-
Transformers: transformers configured in the application.
-
Validators: validators configured in the application.
Services Tab
The Services tab displays information about the services provided by the application. This information includes the services provided by the application and the component services used to implement the services.
The Services table displays the services provided by the application. The table provides the following details:
Clicking on an item in the Name column will load the open the main Services page displaying details for that service. Clicking on an item in the Promoted Service column will highlight the corresponding item in the Component Services table below.
The Component Services table displays the component services defined in the application. This table provides the following details:
-
Name: the name of the component service
-
Interface: the interface implemented by the component
-
Implementation: provides a link for viewing the implementation details of the component
Clicking on an item in the Implementation column will open a dialog detailing the component's implementation.
The Implementation dialog provides the following information:
-
The technology used to implement the component (e.g. Camel).
-
A list of references required by the component.
-
The raw configuration for the implementation.
References Tab
The References tab lists all the composite references used by the application.
Properties Tab
The Properties tab provides a list of properties defined in the application. In addition to viewing the properties, this page may be used to update the values for individual properties.
Artifacts Tab
The Artifacts tab provides information about the artifacts referenced by the application and is comprised of a table providing the following details:
Clicking on an item in the table will navigate to the main Artifacts page.
Validators Tab
The Validators tab provides details about the validators deployed by the application, providing the following details:
Services
The main Services tab displays all services provided by the deployed applications. Selecting a specific service will populate the Service Details section below the list. Details displayed include:
-
Name: the service name
-
Namespace: the namespace within which the service is defined
-
Application: the application providing the service (this links to the main Applications tab)
-
Interface: the interface provided by the service.
-
Promoted Service: the component service implementing the service.
-
Gateways: lists the gateways providing access to the service.
-
Throttling: throttling configuration for the service
Gateways Tab
The Gateways tab in the details section provides the following information for each of the gateways provided for the service:
-
Name: the name of the gateway
-
Type: the type of the gateway (e.g. SOAP, HornetQ, etc.)
-
Status: the status of the gateway (e.g. started, stopped)
-
Start/Stop: starts or stops the gateway
-
Configuration: opens a dialog displaying the raw configuration for the gateway
Throttling Tab
The Throttling tab in the details section allows the user to view throttling details for the service.
-
Edit: switch to edit mode, allowing the user to change the throttling configuration.
-
Enable: enable/disable throttling for the service
-
Maximum Requests: the maximum number of requests per period before throttling occurs
-
Time Period: the time period over which requests are counted (cannot be edited)
References
The main References tab displays all service references used by the deployed applications. Selecting a specific reference will populate the Reference Details section below the list. Details displayed include:
-
Name: the name of the reference
-
Namespace: the namespace within which the reference is defined
-
Application: the application containing the reference (this links to the main Applications tab)
-
Interface: the interface provided by the reference.
-
Gateways: lists the gateways through which the reference is accessed.
The Gateways section provides the following information for each of the gateways configured for the reference:
-
Name: the name of the gateway
-
Type: the type of the gateway (e.g. SOAP, HornetQ, etc.)
-
Status: the status of the gateway (e.g. started, stopped)
-
Start/Stop: starts or stops the gateway
-
Configuration: opens a dialog displaying the raw configuration for the gateway
Artifacts
The main Artifacts tab displays all artifacts referenced by applications deployed to the system. Selecting a specific artifact reference will populate the Applications Using Artifact table below. Selecting an application in the applications table will navigate to the main Applications tab.
Subsystem Configuration View
SwitchYard contributes an additional view to the standard JBoss AS management console's Profile page, which can be accessed by selecting the Subsystems -> SwitchYard -> Runtime Details node. This page displays details about to the SwitchYard subsystem configured in the AS configuration profile.
This page displays the version of the SwitchYard runtime, along with a list of installed components. Selecting a component will populate the Component Details section below, which displays:
-
Name: the component name, e.g. SOAP, Camel.
-
Type: the component type, e.g. soap, camel. (The type is the suffix used within switchyard.xml identifying component specific elements, e.g. binding.soap, implementation.camel.)
-
A section providing component specific details. For most components, this section lists any configurable properties and their current settings.
JMX
The core admin API of SwitchYard is wrapped with a set of MBeans allowing for local and remote access for JMX clients. All SwitchYard MBeans are registered under the org.switchyard.admin JMX domain name.
MBeans related to application management are not registered until the first SwitchYard application is deployed.
MBeans
Management.Local
ObjectName
|
org.switchyard.admin:type=Management.Local
|
Description
|
Intended for use by local JMX clients (same VM as the application) to register event listeners with the SwitchYard runtime.
|
Interface
|
LocalManagementMBean
|
Application
ObjectName
|
org.switchyard.admin:type=Application,name="<app-qname>"
|
Description
|
Management interface for a SwitchYard application.
|
Interface
|
ApplicationMXBean
|
Service
ObjectName
|
org.switchyard.admin:type=Service,name="<service-qname>"
|
Description
|
Management interface for a composite service in a SwitchYard application. One MBean is registered per composite service.
|
Interface
|
ServiceMXBean
|
Reference
ObjectName
|
org.switchyard.admin:type=Reference,name="<reference-qname>"
|
Description
|
Management interface for a composite reference in a SwitchYard application. One MBean is registered per composite reference.
|
Interface
|
ReferenceMXBean
|
Binding
ObjectName
|
org.switchyard.admin:type=Binding,name="<binding-name>",service="<service-qname>" org.switchyard.admin:type=Binding,name="<binding-name>",reference="<reference-qname>"
|
Description
|
Management interface for a gateway binding attached to a composite service or reference. One MBean is registered per binding instance on an application's composite services and references.
|
Interface
|
BindingMXBean
|
ComponentService
ObjectName
|
org.switchyard.admin:type=ComponentService,name="<service-qname>"
|
Description
|
Management interface for a component service in a SwitchYard application. One MBean is registered per component service.
|
Interface
|
ComponentServiceMXBean
|
ComponentReference
ObjectName
|
org.switchyard.admin:type=ComponentReference,name="<reference-qname>,service="<service-qname>"
|
Description
|
Management interface for a component reference in a SwitchYard application. One MBean is registered per component reference.
|
Interface
|
ComponentReferenceMXBean
|
Validator
ObjectName
|
org.switchyard.admin:type=Validator,name="<type>"
|
Description
|
Management interface for a validator in a SwitchYard application. One MBean is registered per validator.
|
Interface
|
ValidatorMXBean
|
Throttling
ObjectName
|
org.switchyard.admin:type=Throttling,service="<service-qname>"
|
Description
|
Management interface for throttling a service in a SwitchYard application. One ThrottlingMBean is registered per composite service instance.
|
Interface
|
ThrottlingMXBean
|
Lifecycle
ObjectName
|
none
|
Description
|
Supertype of BindingMXBean which provides operations related to lifecycle control for service and reference bindings.
|
Interface
|
LifecycleMXBean
|
Metrics
ObjectName
|
none
|
Description
|
Supertype of multiple MBeans providing message metrics information.
|
Interface
|
MessageMetricsMXBean
|
BPEL Console
The BPEL console can be deployed to SwitchYard through its installer since SwitchYard-0.4 version.
Overview
This section provides an overview of the BPEL Console. The console provides the ability to view:
-
The process definitions deployed to the BPEL engine
-
The process instances executing in the BPEL engine
-
The execution history of a process
-
The history instances query
Installation
The easiest way to install the BPEL console is to download the SwitchYard installer and then run :
You will then be prompted for the location of your EAP installation, and the Installer will place the necessary WAR files in EAP.HOME/standalone/deployments.
Alternatively, you can just simply copy the switchyard-bpel-console.war folder and switchyard-bpel-console-server.war from the Tools distribution into the EAP_HOME/standalone/deployments folder. Remember that you will need to add a marker file named "switchyard-bpel-console.war.dodeploy" in the deployments folder as well to trigger the deployment.
BPEL Database Configuration
Overview
In BPEL component, we are using the in-memory H2 database, this page is trying to give you an example that update it to a Mysql database.
Changing database steps
Download db ANT script.
Download the db ANT script zip from here, we use the RiftSaw-3.0.0 Final release (used in SwitchYard 1.0.0.Final) as an example.
Create and install the mysql database driver.
-
create the folder in $SwitchYard/modules/mysql/main, and then copy the mysql-connector-java-5.1.12.jar (of course, you can choose other versions, but in this page, we are using this version as an example) inside it.
-
create a module.xml along with it, the content is like following:
<module xmlns="urn:jboss:module:1.1" name="mysql">
<resources>
<resource-root path="mysql-connector-java-5.1.12.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
-
add the mysql driver and the datasource in standalone.xml file.
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
.....
<datasource jndi-name="java:jboss/datasources/BpelDS" enabled="true" use-java-context="true" pool-name="BpelDS">
<connection-url>jdbc:mysql://localhost:3306/riftsaw</connection-url>
<driver>mysql</driver>
<pool/>
<security>
<user-name>root</user-name>
<password>jeff</password>
</security>
</datasource>
<drivers>
...
<driver name="mysql" module="mysql">
<driver-class>com.mysql.jdbc.Driver</driver-class>
</driver>
</drivers>
</datasources>
</subsystem>
Override the properties for bpel component in standalone.xml file
Go to the $SwitchYard/standalone/configuration/standalone.xml, find the BPELComponent, and then overriding following properties:
<module identifier="org.switchyard.component.bpel" implClass="org.switchyard.component.bpel.deploy.BPELComponent">
<properties>
<bpel.db.mode>EXTERNAL</bpel.db.mode>
<db.emb.create>false</db.emb.create>
<bpel.db.ext.dataSource>java:jboss/datasources/BpelDS</bpel.db.ext.dataSource>
<hibernate.dialect>org.hibernate.dialect.MySQLInnoDBDialect</hibernate.dialect>
</properties>
</module>
Then you should be ready to start the SwitchYard, the BPEL component will use the database that you created.