||
Skip to end of metadata
Go to start of metadata

This page describes how to create artifacts for the Enterprise Service Bus (ESB). It contains the following sections:

Configuring the ESB version

The ESB editor in Developer Studio can support ESB 4.x (which contains many new mediators) or ESB 3.0.1. To configure the version you want to support, click Windows > Preferences (Eclipse > Preferences on a Mac), expand the Developer Studio category and click ESB, and then select the version you want to support. If you are editing an existing ESB configuration, reload the editor to apply the version change.

Getting help in the source view

When working with your ESB configurations in the Source view instead of the Design view, you can hover your mouse over any element (such as the definitions tag) to see the syntax of that element. You can also press Ctrl + Space to get suggested auto-completion text.

For example, if you view a proxy service in the Source view, and you remove the / from the <inSequence/> element and press Ctrl + space, the Content Assist appears and lists all the options you can add at this point, including the closing  </inSequence> element.

Creating an ESB Config project

You can create an ESB Config Project to save all the ESB related artifacts such as proxy services, endpoints, sequences, and synapse configurations.

To create an ESB Config Project:

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click ESB Config Project in the Enterprise Service Bus category.



  2. If you want to create this ESB project from existing configuration files, select Point to Existing Synapse-configs Folder. Otherwise, leave New ESB Config Project selected. Click Next.
  3. Do the following:
    1. Type a unique name for the project.
    2. If you selected the option to point to an existing Synapse-configs folder in the previous step, click Browse and navigate to the folder containing the configuration files.
    3. Optionally specify the location where you want to save the project (or leave the default location specified).
    4. Optionally specify the working set, if any, that you want to include in this project.
  4. A Maven POM file will be generated automatically for this project. If you want to include parent POM information in the file from another project in this workspace, click Next, click the Specify Parent from Workspace check box, and then select the parent project.
  5. Click Finish.
  6. If you specified a folder with existing configuration files, specify whether you want to open those files now.

The new project has now been created in the workspace. If you browse inside the project, you will see a project structure as below, with folders created for different resources such as endpoints, local entries, proxy services, and sequences.

Creating an endpoint

An endpoint is the address of a service where messages are sent. Typically, the endpoint is the address of a proxy service, which acts as the front end to the actual service.

When you create an endpoint, you give it a name, at which point it appears in the Defined Endpoint section of the tool palette in Developer Studio. To use a defined endpoint, simply drag and drop it from the palette to the sequence, proxy service, or other artifact where you want to reference it.

You can create a new endpoint or import an existing endpoint from an XML file, such as a Synapse Configuration file.

Creating a new endpoint

Follow these steps to create a new endpoint. Alternatively, you can import an existing endpoint.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Endpoint in the Enterprise Service Bus area.
  2. Select Create a New Endpoint and click Next.
  3. Type a unique name for the endpoint, and then specify the type of endpoint you are creating.
  4. Do one of the following:
    • To save the endpoint in an existing ESB Config project in your workspace, click Browse and select that project.
    • To save the endpoint in a new ESB Config project, click Create new Project and create the new project.
    • To save the endpoint in a registry resource project, click Make this a Dynamic Endpoint, click the Browse button next to Save endpoint in and select the registry, and then select the registry (Configuration or Governance) where you want to save the endpoint. Lastly, type the endpoint name in the Registry Path box. 
  5. In the Advanced Configuration section (which changes based on the type of endpoint you are creating), specify any additional options you need for that endpoint type.
  6. Click Finish. The endpoint is created in the endpoints folder under the ESB Config or Registry Resource project you specified, and the endpoint is open in the editor.

Importing an endpoint

Follow these steps to import an existing endpoint from an XML file (such as a Synapse configuration file) into an ESB Config project. Alternatively, you can create a new endpoint.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Endpoint in the Enterprise Service Bus area.
  2. Select Import Endpoint and click Next.
  3. Specify the endpoint file by typing its full path name or clicking Browse and navigating to the file.
  4. In the Save Endpoint In field, specify an existing ESB Config project in your workspace where you want to save the endpoint, or click Create new Project to create a new ESB Config project and save the endpoint there.  
  5. In the Advanced Configuration section, select the endpoints you want to import. 
  6. Click Finish. The endpoints you selected are created in the endpoints folder under the ESB Config project you specified, and the first endpoint is open in the editor.

Creating an inbound endpoint

An inbound endpoint is a message source that can be configured dynamically and resides in the server side of the WSO2 ESB. Inbound endpoints achieve multi tenancy support for all transports.

The following types of protocols are supported by inbound endpoints:

  • HTTP

  • HTTPS

  • File

  • JMS

  • HL7

  • KAFKA

  • CXF_WS_RM

See the inbound endpoint samples in the ESB Documentation for more information.

Create an inbound endpoint in the ESB Config project you created above by following the instructions below. You can create a new inbound endpoint or import an existing inbound endpoint from an XML file, such as a Synapse Configuration file.

Create a new inbound endpoint

Follow the steps below to create a new inbound endpoint. Alternatively, you can import an existing inbound endpoint.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Inbound Endpoint in the Enterprise Service Bus area.
  2. Alternatively, right-click on the ESB Config project and then click New > Inbound Endpoint.
  3. Select Create a New Inbound Endpoint and click Next.
  4. Give a name for the inbound endpoint, select the protocol type and click Finish.
  5. The created inbound endpoint will open in the ESB Graphical Editor as shown below:


     
  6. Drag and drop a sequence and an onError sequence from the tool palette as shown below:


     
  7. If you want to browse a sequence from the registry, right-click on the sequence and click Show Properties View.
  8. Point to an existing sequence in the registry in the Static Reference Key property.


     
  9. Right-click on the inbound endpoint and click Show Properties View to open the Property window.
  10. Update the parameters as preferred and the changes will be saved in the inbound endpoint configuration.

Import an existing inbound endpoint

Follow the steps below to import an existing inbound endpoint from an XML file (such as a Synapse configuration file) into an ESB Config project. Alternatively, you can create a new inbound endpoint.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Inbound Endpoint in the Enterprise Service Bus area.
  2. Alternatively, right-click on the ESB Config project and then click New > Inbound Endpoint.
  3. Select Import Inbound Endpoint and click Next.
  4. Specify the inbound endpoint file by typing its full path name or clicking Browse and navigating to the file.
  5. In the Save Inbound Endpoint In field, specify an existing ESB Config project in your workspace where you want to save the inbound endpoint, or click Create new ESB Project to create a new ESB Config project and save the endpoint there.  
  6. In the Advanced Configuration section, select the inbound endpoints you want to import. 
  7. Click Finish. The inbound endpoints you selected are created in the inbound-endpoints folder under the ESB Config project you specified, and the first inbound endpoint is open in the editor.

Working with local entries

A local entry is used to store static content as a key-value pair, where the value could be a static entry such as a text string, XML code, or a URL. This is useful for the type of static content often found in XSLT files, WSDL files, URLs, etc. Local entries can be referenced from mediators in ESB mediation flows and resolved at runtime.

You can create a new local entry or import an existing local entry from an XML file, such as a Synapse Configuration file.

Creating a new local entry

Follow these steps to create a new local entry. Alternatively, you can import an existing local entry.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Local Entry in the Enterprise Service Bus area.
  2. Select Create a New Local Entry and click Next.
  3. Type a unique name for the local entry, specify one of the following types of local entries, and then fill in the advanced configuration as described below:
    • In-Line Text Entry: Type the text you want to store
    • In-Line XML Entry: Type the XML code you want to store
    • Source URL Entry: Type or browse to the URL you want to store
  4. Do one of the following:
    • To save the local entry in an existing ESB Config project in your workspace, click Browse and select that project.
    • To save the local entry in a new ESB Config project, click Create new Project and create the new project.
  5. Click Finish. The local entry is created in the local-entries folder under the ESB Config project you specified, and the local entry appears in the editor. Click its icon in the editor to view its properties.

Importing a local entry

Follow these steps to import an existing local entry from an XML file (such as a Synapse configuration file) into an ESB Config project. Alternatively, you can create a new local entry.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Local Entry in the Enterprise Service Bus area.
  2. Select Import Local Entry and click Next.
  3. Specify the local entry file by typing its full path name or clicking Browse and navigating to the file.
  4. In the Save Local Entry In field, specify an existing ESB Config project in your workspace where you want to save the local entry, or click Create new Project to create a new ESB Config project and save the local entry there.  
  5. In the Advanced Configuration section, select the local entries you want to import.
  6. Click Finish. The local entries you selected are created in the local-entries folder under the ESB Config project you specified, and the first local entry appears in the editor.

Using a local entry

After you create a local entry, you can reference it from a mediator in your mediation workflow. For example, if you created a local entry with XSLT code, you could add an XSLT mediator to the workflow and then reference the local entry as follows:

  1. Click the XSLT mediator to display its properties, click the XSLT Static Schema Key property, and then click the browse [...] button on the far right of the property's value.
  2. Click the Workspace link, and then navigate to and select the local entry that contains the XSLT code.
  3. Click OK.

Working with sequences

A sequence is a tree of mediators that you can use in your mediation workflow. You can create a sequence in your ESB Config project or in the registry and then add it right to that project's mediation workflow, or you can refer to it from a sequence mediator in this project or another project in this Eclipse workspace. 

This section describes how to create a new sequence or import an existing sequence from an XML file (such as a Synapse Configuration file), and how to use the sequence in your mediation flow.

About dynamic sequences

Developer Studio allows you to create a Registry Resource project, which can be used to store Resources and Collections you want to deploy to the registry of a Carbon Server through a Composite Application (C-App) project. When you create a sequence, you can save it as a dynamic sequence in the Registry Resource project and refer to that sequence from the mediation flow. At runtime, when you deploy the CAR file with both the Registry Resource project and mediation flow, WSO2 ESB looks up and uses the sequence from the registry.

Creating a new sequence

Follow these steps to create a new, reusable sequence that you can add to your mediation workflow or refer to from a sequence mediator, or to create a sequence mediator and its underlying sequence all at once. Alternatively, you can import an existing sequence.

To create a reusable sequence:

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Sequence in the Enterprise Service Bus area.
  2. Select Create New Sequence and click Next.
  3. Type a unique name for the sequence. 

    Creating a Main Sequence

    If you want to create the default main sequence, which just sends messages without mediation, be sure to name it main, which automatically populates the sequence with the default in and out sequences.

  4. Do one of the following:
    • To save the sequence in an existing ESB Config project in your workspace, click Browse and select that project.
    • To save the sequence in a new ESB Config project, click Create new Project and create the new project.
    • To save the sequence as a dynamic sequence in a Registry Resource project, click Make this as Dynamic Sequence, specify the registry space (Governance or Configuration), click the Browse button at the top of the dialog box next to Save Sequence in and select the registry resource project, and then type the sequence name in the Registry Path box.
  5. Optionally, in the Advanced Configuration section, specify another sequence to run when there is an error and the endpoint where messages should be sent.
  6. Click Finish. The sequence is created in the sequences folder under the ESB Config or Registry Resource project you specified, and the sequence is open in the editor.
  7. Add the endpoints and other sequences you want in this sequence and then click File > Save.

The sequence is now available in the Defined Sequences section of the tool palette and ready for use.

To create a sequence when creating a sequence mediator:

  1. With your proxy service open in the editor, click Sequence Mediator in the tool palette and then click the location in the mediation workflow where you want to add this sequence.
    The sequence mediator is added to the workflow with a default name, which is highlighted and ready for you to change.
  2. Type the name you want for this sequence mediator and press Enter.
  3. Double-click the sequence mediator you just added. A sequence is created and opened in the editor using the same name you entered for the sequence mediator.
  4. Add the endpoints and other sequences you want in this sequence, and then click File > Save.

The mediation workflow is updated with the endpoints you added to the sequence. The sequence is also now available in the Defined Sequences section of the tool palette and ready for use in other meditation workflows.

Importing a sequence

Follow these steps to import an existing sequence from an XML file (such as a Synapse configuration file) into an ESB Config project. Alternatively, you can create a new sequence.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Sequence in the Enterprise Service Bus area.
  2. Select Import Sequence and click Next.
  3. Specify the sequence file by typing its full path name or clicking Browse and navigating to the file.
  4. In the Save Sequence In field, specify an existing ESB Config project in your workspace where you want to save the sequence, or click Create new Project to create a new ESB Config project and save the sequence there.  
  5. In the Advanced Configuration section, select the sequences you want to import. 
  6. Click Finish. The sequences you selected are created in the sequences folder under the ESB Config project you specified, and the first sequence is open in the editor.

Using a sequence



If you want to use a sequence from a different project or from the registry, you create a sequence mediator and then refer to the sequence as follows:

  1. Click Sequence Mediator on the tool palette, and then click the spot on the canvas where you want the sequence to appear in the mediation workflow.
  2. Press Enter to accept the default name for now.
  3. In the Properties pane at the bottom of the window, click Static Reference Key, and then click the browse [...] button on the right.

  4. In the Resource Key Editor, click Registry if the sequence is stored in the registry or Workspace if it's in another ESB Config project in this Eclipse workspace.
  5. If you are trying to select a sequence from the registry and no entries appear in the dialog box, click the add registry connection button (the first button in the upper right corner) and connect to the registry where the sequence resides.
  6. Navigate to the sequence you want, select it and click OK, and then click OK again.

The sequence mediator name and static reference key are updated to point to the sequence you selected.

Working with connectors

A connector allows your message workflow to connect to and interact with an online service such as Twitter or Google Spreadsheets. Each connector provides operations that perform different actions in that service. For example, the Twitter connector has operations for creating a tweet, getting a user's followers, and more. There are over a hundred predefined ESB connectors you can download from the WSO2 Connector Store, which connect the ESB to various APIs catering to your enterprise requirements such as, Billing & Accounting, Communication, E-commerce, IoT, Sales & Marketing, HR Management, etc. You can also create your own connectors.

Using WSO2 Developer Studio, you can develop configurations with connectors and deploy these configurations and connectors as Composite Application aRchive (CAR) files into WSO2 Enterprise Service Bus.

Importing connectors

Follow the steps below to import connectors into WSO2 Developer Studio:

  1. Right-click on the ESB Config project where you want to use the connector and click Add or Remove Connector.



  2. On the wizard that appears, select Add Connector and click Next
    1. If you have already downloaded the connectors, select the Connector location option and browse to the connector file from the file system. Click Finish. The connector is imported into the workspace and available for use with all the ESB projects in the workspace.  



    2. If you have not downloaded any connectors, select the Connector Store location option to connect to the connector store from Developer Studio and import the required connectors into the workspace. Set https://store.wso2.com:9448 as the connector store location and click Connect. Select the required connectors and click Finish.



  3. After importing the connectors into Developer Studio, the connector operations are available in the tool palette. You can drag and drop connector operations into your sequences and proxy services.

For complete information on each of the predefined connectors, see ESB connectors.

Removing connectors

Follow the steps below to remove connectors from WSO2 Developer Studio:

  1. Right-click on the relevant ESB Config project and click Add or Remove Connector.
  2. On the wizard that appears, select Remove Connector and click Next
  3. Select the connectors you want to remove and click Finish.

     

Creating a CAR file including connectors

Follow the steps below to create a Composite Application aRchive (CAR) file containing the connectors:

  1. Click File > New > Other and select Connector Exporter Project under WSO2 > Extensions > Project Types and click Next.

     
     
  2. Alternatively, open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Connector Exporter Project in the Enterprise Service Bus area.
  3. Enter a project name and click Finish.

     
     
  4. Right-click on the created connector exporter project, point to New and then click Add/Remove Connectors.

     
     
  5. Click Add Connector and then File System and select the connector files (.zip) from the file system. Click Finish. Connector files downloaded from the connector store are stored in the $workspace/.metadata/.Connectors folder.

     
     

  6. Create a Composite Application (C-App) project including the required artifacts.

     
     
  7. Right-click on the C-App project and click Export Composite Application Project to create a CAR file out of that project.

For more information, see Packaging Artifacts Into Deployable Archives

Creating a proxy service

A proxy service is a virtual service that receives messages and optionally processes them before forwarding them to a service at a given endpoint. It acts as a front end to the service, allowing you to define a mediation workflow that performs whatever logic is needed on the message before sending it to the actual service.

You can create a new proxy service or import an existing proxy service from an XML file, such as a Synapse Configuration file.

Creating a new proxy service

Follow these steps to create a proxy service. Alternatively, you can import an existing proxy service.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Proxy Service in the Enterprise Service Bus area.
  2. Select Create a New Proxy Service and click Next.
  3. Type a unique name for the proxy service and specify the proxy type (see below).
  4. Do one of the following:
    • To save the proxy service in an existing ESB Config project in your workspace, click Browse and select that project.
    • To save the proxy service in a new ESB Config project, click Create new ESB Project and create the new project.
  5. If you specified a proxy type that requires that you enter the target endpoint (the endpoint that represents the actual service), do one of the following:
    • If you know the URL of the endpoint, select Enter URL and type it in the text box.
    • If you want to use an endpoint you've already defined in this workspace, select Predefined Endpoint and select it from the list.  
    • If you want to use an endpoint in the registry, select Pick from Registry, and then either type the endpoint's registry key or click Browse, click Registry, and navigate to the endpoint in the registry.
  6. Fill in the advanced configuration based on the proxy service type you specified:
    • Transformer Proxy: Transforms all the incoming requests using XSLT and then forwards them to a given target endpoint. Specify the target endpoint as described in the previous step, and then specify the location of the XSLT you want to use to transform requests, either by typing the path or by clicking Browse and navigating to the XSLT, which can be a file in the workspace or registry or can be a local entry. If you also want to transform the responses from the backend service, click Transform Responses.
    • Log Forward Proxy: Logs all the incoming requests and forwards them to a given endpoint. It can also log responses from the backend service before routing them to the client. Specify the log level for requests and responses, where Simple logs To, From, WSAction, SOAPAction, ReplyTo, MessageID, and any properties, and Full logs all attributes of the message plus the SOAP envelope information.
    • Pass Through Proxy: Forwards messages to the endpoint without performing any processing on them. This proxy service is useful as a catch-all, so that messages that do not meet the criteria to be handled by other proxy services are simply forwarded to the endpoint. When you select this proxy service type, you just specify the target endpoint as described in the previous step.
    • WSDL Based Proxy: A proxy service that is created from the remotely hosted WSDL of an existing web service. The endpoint information is extracted from the WSDL. In the URI field, enter the URL and URN of the WSDL. The URL defines the host address of the network resource (can be omitted if resources are not network homed), and the URN defines the resource name in local namespaces. For example, if the URL is ftp://ftp.dlink.ru and the URN is /pub/ADSL/, you would enter ftp://ftp.dlink.ru/pub/ADSL/ for the URI. To ensure that the URI is valid, click Test URI. You then enter the service name and port of the WSDL. Lastly, if you want to publish this WSDL, click Publish Same Service Contract.
    • Secure Proxy: Uses WS-Security to process incoming requests and forward them to an unsecured backend service. Specify the target endpoint as described in the previous step, and then specify the key of the security policy or click Browse and select it from the registry.
    • Custom Proxy: A custom proxy service in which you customize all the sequences, endpoints, transports, and other QoS settings by adding them to the mediation workflow after the proxy service is created.
  7. Click Finish. The proxy service is created in the src/main/synapse-config/proxy-service folder under the ESB Config Project you specified, and the proxy service appears in the editor. Click its icon in the editor to view its properties.

Importing a proxy service

Follow these steps to import an existing proxy service from an XML file (such as a Synapse configuration file) into an ESB Config project. Alternatively, you can create a new proxy service.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Proxy Service in the Enterprise Service Bus area.
  2. Select Import Proxy Service and click Next.
  3. Specify the proxy service file by typing its full pathname or clicking Browse and navigating to the file.
  4. In the Save Proxy Service In field, specify an existing ESB Config project in your workspace where you want to save the proxy service, or click Create new ESB Project to create a new ESB Config project and save the proxy service there.  
  5. If there are multiple proxy services in the file, in the Advanced Configuration section select the proxy services you want to import.
  6. Click Finish. The proxy services you selected are created in the src/main/synapse-config/proxy-service folder under the ESB Config project you specified, and the first proxy service appears in the editor.

Importing a Synapse configuration

A Synapse configuration file contains one or more ESB artifacts, such as endpoints and sequences. You can import an existing Synapse configuration to import all its ESB artifacts in one step.

Follow these steps to import an existing Synapse configuration into an ESB Config project. 

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Synapse in the Enterprise Service Bus area.
  2. Specify the Synapse configuration file by typing its full path name or clicking Browse and navigating to the file.
  3. In the Save Synapse Configuration in field, specify an existing ESB Config project in your workspace where you want to save the configuration, or click Create new ESB Project to create a new ESB Config project and save the Synapse configuration there.
  4. Select the artifacts you want to import.
  5. Click Finish. The artifacts you selected are created in the subfolders of src/main/synapse-config folder under the ESB Config project you specified, and the first artifact appears in the editor.

Creating a REST API

Creating a REST API

Follow these steps to create a REST API. Alternatively, you can import an existing REST API.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click REST API in the Enterprise Service Bus area.
  2. Leave the first option selected and click Next.
  3. Type a unique name for the REST API and specify the context, hostname, and port. For more information, see Configuring Endpoints using REST APIs in the ESB documentation.
  4. Do one of the following:
    • To save the API in an existing ESB Config project in your workspace, click Browse and select that project.
    • To save the API in a new ESB Config project, click Create new ESB Project and create the new project.
  5. Click Finish. The REST API is created in the src/main/synapse-config/api folder under the ESB Config project you specified. When prompted, you can open the file in the editor, or you can right-click the API in the project explorer and click Open With > ESB Editor. Click its icon in the editor to view its properties.

Importing a REST API

Follow these steps to import an existing REST API into an ESB Config project. Alternatively, you can create a new REST API.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click REST API in the Enterprise Service Bus area.
  2. Select Import API Artifact and click Next.
  3. Specify the XML file that defines the API by typing its full pathname or clicking Browse and navigating to the file.
  4. In the Save API In field, specify an existing ESB Config project in your workspace where you want to save the API, or click Create new ESB Project to create a new ESB Config project and save the API configuration there.
  5. If there are multiple API definitions in the file, click Create ESB Artifacts, and then select the artifacts you want to import.
  6. Click Finish. The APIs you selected are created in the subfolders of the src/main/synapse-config/api folder under the ESB Config project you specified, and the first API appears in the editor.

Adding an API resource

Follow these steps to add an API resource to an existing REST API.
  1. Open an existing REST API in the editor.
  2. In the tool palette, click APIResource in the API section and simply drag and drop the resource to the REST API.
  3. You can now add mediators, endpoints etc to the resource and save.

Creating a scheduled task

Creating a task

Follow these steps to create a new scheduled task. Alternatively, you can import an existing task.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Scheduled Task in the Enterprise Service Bus area.
  2. Leave the first option selected and click Next.
  3. Type a unique name for this scheduled task and specify the group, implementation class, and other options. For more information, see Adding and Scheduling Tasks in the ESB documentation.
  4. Do one of the following:
    • To save the task in an existing ESB Config project in your workspace, click Browse and select that project.
    • To save the task in a new ESB Config project, click Create new ESB Project and create the new project.
  5. Click Finish. The scheduled task is created in the src/main/synapse-config/tasks folder under the ESB Config project you specified. When prompted, you can open the file in the editor, or you can right-click the task in the project explorer and click Open With > ESB Editor. Click its icon in the editor to view its properties.

Importing a task

Follow these steps to import an existing scheduled task into an ESB Config project. Alternatively, you can create a new task.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Scheduled Task in the Enterprise Service Bus area.
  2. Select Import Scheduled Task Artifact and click Next.
  3. Specify the XML file that defines the scheduled task by typing its full pathname or clicking Browse and navigating to the file.
  4. In the Save Task In field, specify an existing ESB Config project in your workspace where you want to save the task, or click Create new ESB Project to create a new ESB Config project and save the task configuration there.
  5. If there are multiple tasks definitions in the file, click Create ESB Artifacts, and then select the tasks you want to import.
  6. Click Finish. The tasks you selected are created in the subfolders of the src/main/synapse-config/tasks folder under the ESB Config project you specified, and the first task appears in the editor.

Creating a message store

Creating a message store

Follow these steps to create a new message store. Alternatively, you can import an existing message store.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Message Store in the Enterprise Service Bus area.
  2. Leave the first option selected and click Next.
  3. Type a unique name for this message store, specify the type of store you're creating, and then fill in the options for that store type. For details on creating message stores, see the ESB documentation.
  4. Do one of the following:
    • To save the message store in an existing ESB Config project in your workspace, click Browse and select that project.
    • To save the message store in a new ESB Config project, click Create a new ESB Project and create the new project.
  5. Click Finish. The message store is created in the src/main/synapse-config/message-stores folder under the ESB Config project you specified and appears in the editor. You can click its icon in the editor to view its properties.

Importing a message store

Follow these steps to import an existing message store into an ESB Config project. Alternatively, you can create a new message store.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Message Store in the Enterprise Service Bus area.
  2. Select Import a Message Store and click Next.
  3. Specify the XML file that defines the message store by typing its full path name or clicking Browse and navigating to the file.
  4. In the Save In field, specify an existing ESB Config project in your workspace where you want to save the message store, or click Create new Project to create a new ESB Config project and save the message store configuration there.
  5. Click Finish. The message store is created in the src/main/synapse-config/message-stores folder under the ESB Config project you specified and appears in the editor.

Creating a message processor

Be sure to create the message store before creating the message processor, as you will need to specify the message store that this processor applies to.

Creating a message processor

Follow these steps to create a new message processor. Alternatively, you can import an existing message processor.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Message Processor in the Enterprise Service Bus area.
  2. Leave the first option selected and click Next.
  3. Type a unique name for this message processor, specify the type of processor you're creating, specify the message store this processor applies to, and then fill in the options for the processor type you selected. For details on creating message processors, see the ESB documentation.
  4. Do one of the following:
    • To save the message processor in an existing ESB Config project in your workspace, click Browse and select that project.
    • To save the message processor in a new ESB Config project, click Create a new ESB Project and create the new project.
  5. Click Finish. The message processor is created in the src/main/synapse-config/message-processors folder under the ESB Config project you specified and appears in the editor. You can click its icon in the editor to view its properties.

Importing a message processor

Follow these steps to import an existing message processor into an ESB Config project. Alternatively, you can create a new message processor.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Message Processor in the Enterprise Service Bus area.
  2. Select Import a Message Processor and click Next.
  3. Specify the XML file that defines the message processor by typing its full path name or clicking Browse and navigating to the file.
  4. In the Save In field, specify an existing ESB Config project in your workspace where you want to save the message processor, or click Create new Project to create a new ESB Config project and save the message processor configuration there.
  5. Click Finish. The message processor is created in the src/main/synapse-config/message-processors folder under the ESB Config project you specified and appears in the editor.

Creating a template

Creating a template

Follow these steps to create a new scheduled task. Alternatively, you can import an existing template.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Template in the Enterprise Service Bus area.
  2. Leave the first option selected and click Next.
  3. Type a unique name for this template and specify the type of template you're creating.
  4. Do one of the following:
    • To save the template in an existing ESB Config project in your workspace, click Browse and select that project.
    • To save the template in a new ESB Config project, click Create new Project and create the new project.
  5. If you specified an address or WSDL endpoint as the template type, enter the URL for the address or the WSDL URI and connection information in the Advanced Configuration fields.
  6. Click Finish. The template is created in the src/main/synapse-config/templates folder under the ESB Config project you specified. When prompted, you can open the file in the editor, or you can right-click the template in the project explorer and click Open With > ESB Editor. Click its icon in the editor to view its properties.

Importing a template

Follow these steps to import an existing template into an ESB Config project. Alternatively, you can create a new template.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Template in the Enterprise Service Bus area.
  2. Select Import a Template and click Next.
  3. Specify the XML file that defines the template by typing its full path name or clicking Browse and navigating to the file.
  4. In the Save Template In field, specify an existing ESB Config project in your workspace where you want to save the template, or click Create new Project to create a new ESB Config project and save the template configuration there.
  5. If there are multiple template definitions in the file, click Create ESB Artifacts, and then select the templates you want to import.
  6. Click Finish. The templates you selected are created in the subfolders of the src/main/synapse-config/templates folder under the ESB Config project you specified, and the first template appears in the editor.

Creating a mediator

A mediator project allows you to create a custom mediator that performs some logic on a message. You can create a new mediator project, or you can import an existing mediator project from the workspace.

Once the mediator project is finalised, you can export it as a deployable artifact by right-clicking on the project and selecting Export Project as Deployable Archive. This creates a JAR file that you can deploy to a WSO2 ESB. Alternatively, you can group the mediator project as a Composite Application Project, create a Composite Application Archive (CAR), and deploy it to the ESB.

From ESB 4.8.1 onwards, a URL classloader is used to load classes in the mediator (class mediators are not deployed as OSGi bundles). Therefore, it is only possible to refer to the class mediator from artifacts packed in the same CAR file in which the class mediator is packed. Accessing the class mediator from an artifact packed in another CAR file is not possible. However, it is possible to refer to the class mediator from a sequence packed in the same CAR file and call that sequence from any other artifact packed in other CAR files.

Creating a mediator project

Follow these steps to create a new mediator. Alternatively, you can import a mediator project.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Mediator Project in the Enterprise Service Bus area.
  2. Leave the first option selected and click Next. The New Mediator Creation Wizard appears.



  3. Do the following:
    1. Type a unique name for the project.
    2. Specify the package and class names you are creating.
    3. Optionally specify the location where you want to save the project (or leave the default location specified).
    4. Optionally specify the working set, if any, that you want to include in this project.
  4. A Maven POM file will be generated automatically for this project. If you want to include parent POM information in the file from another project in this workspace, click Next, click the Specify Parent from Workspace check box, and then select the parent project.
  5. Click Finish.

The mediator project is created in the workspace location you specified with a new mediator class that extends org.apache.synapse.mediators.AbstractMediator.

Importing a Java Mediator Project 

Follow the steps below to import a Java mediator project (that includes a Java class, which extends the org.apache.synapse.mediators.AbstractMediator class) to WSO2 Developer Studio.

  1. Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Mediator Project in the Enterprise Service Bus area.
  2. Select Import From Workspace and click Next.
  3. Specify the mediator project in this workspace that you want to import. Only projects with source files that extend org.apache.synapse.mediators.AbstractMediator are listed. Optionally, you can change the location where the mediator project will be created and add it to working sets.
  4. Click Finish.

The mediator project you selected is created in the location you specified.

The mediator projects you create using WOS2 Developer Studio are of the org.wso2.developerstudio.eclipse.artifact.mediator.project.nature nature by default. Follow the steps below to view this nature added to the <PROJECT_NAME>/target/.project file of the Java mediator project you imported.

  • Click the View Menu icon, and click Customize View.
  • Deselect .*resources, and click OK.

For information on importing a mediator project, which you created using WSO2 Developer Studio, see Importing Existing Projects.

Creating a Smooks configuration artifact

Smooks is an extensible framework for building applications that process data, such as binding data objects and transforming data. To create a Smooks configuration artifact, you must first create a registry resource as described in Creating Governance Registry Artifacts. When creating the registry resource, select the From Existing Template option and select Smooks Configuration as the template.



The smooksconfig.xml file is created. Double-click it in the Project Explorer to open it in the embedded JBoss Smooks editor.
 



Click Input Task, create the data mapping, and save the configuration file. For more information on mapping data using Smooks in Eclipse, see the Smooks documentation.

Before you can run the Smooks configuration, you must add libraries from the Smooks framework to your registry resources project.

  1. Right-click the registry resources project in the Project Explorer and click Properties.
  2. In the list on the left, click Java Build Path, and then click the Libraries tab.



  3. Click Add Library, click WSO2 Classpath Libraries, and then click Next.
  4. In the WSO2 Classpath Libraries dialog box, click the Smooks tab, click Select All, and click Finish.
  5. In the Properties dialog box, click OK.

All the Smooks-related libraries have been added to the project classpath. You can now run the Smooks configuration file by right-clicking the file and choosing Run As > Smooks Run Configuration. If your Smooks configuration is correct, the console displays the results according to the input model and output model you specified.

You can now add the Smooks configuration artifact to a proxy service or sequence to use it in the ESB. To do so, create a proxy service. Drag and drop a Log mediator and a Smooks mediator to the InSequence. Double-click on the Smooks mediator to see the Property view. Click the button at the right hand corner of the Configuration Key field.

The Resource Key Editor dialog box appears. Specify from where you should select the resource file.

Select Workspace option since we have the created Smooks Configuration in our workspace. Browse for the Smooks Configuration file that we have created and click OK.

Now you have successfully referred to the Smooks configuration within your proxy service.

Moving ESB artifacts between projects

To move an ESB artifact from one project to another, right-click on the artifact (in this instance, Sequence123.xml), click Move and then select the folder to which you want to move the artifact. It is also possible to simply drag and drop the artifact.

      


Deploying the ESB Config project

Once you create all the ESB components such as sequences, proxy services, endpoints, local-entries, you can create a Composite Application Project to group them and create a Composite Application Archive. Before creating the CAR file, make sure to change the server role of the created bundle to EnterpriseServiceBus. To deploy it to WSO2 Enterprise Service Bus, you need to change it to the correct server role.

 

For more information, see Packaging Artifacts Into Deployable Archives.

  • No labels