This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

WSO2 ESB supports several inbound endpoints, but there can be scenarios that require functionality not provided by the existing inbound endpoints. For example, you might need an inbound endpoint to connect to a certain back-end server or vendor specific protocol.

To support such scenarios, you can write your own custom inbound endpoint by further extending the inbound endpoint behaviour. 

Custom listening inbound endpoint

Following is a sample custom listening inbound endpoint configuration:

<inboundEndpoint xmlns="http://ws.apache.org/ns/synapse" name="custom_listener" sequence="request" onError="fault"
	                 class="org.wso2.carbon.inbound.custom.listening.SampleListeningEP" suspend="false">
   <parameters>
      <parameter name="sequential">true</parameter>
	  <parameter name="inbound.behavior">listening</parameter>
      <parameter name="coordination">true</parameter>
   </parameters>
</inboundEndpoint>

In addition to the parameters provided in the above sample configuration, you can provide other required parameters based on the listening behaviour you need to implement.

Custom listening inbound endpoint parameters

Parameter Name

Description

Required

Possible Values

Default Value

class

Name of the custom class implementation

Yes

A valid class name

n/a

sequence

 

Name of the sequence message that should be injectedYesA valid sequence namen/a
onError


Name of the fault sequence that should be invoked in case of failure Yes

A valid fault sequence name

n/a
inbound.behavior

The behaviour of the inbound endpoint

Yes listeningn/a

You can download the maven artifact used in the sample custom listening inbound endpoint configuration above from Custom listening inbound endpoint sample .

You need to copy the built jar file to the <ESB_HOME>/repository/components/lib directory and restart the ESB to load the class.

Custom polling inbound endpoint

Following is a sample custom polling inbound endpoint configuration:

<inboundEndpoint xmlns="http://ws.apache.org/ns/synapse" name="class" sequence="request" onError="fault"
                            class="org.wso2.carbon.inbound.custom.poll.SamplePollingClient" suspend="false">
   <parameters>
      <parameter name="sequential">true</parameter>
      <parameter name="interval">2000</parameter>
      <parameter name="coordination">true</parameter>
   </parameters>
</inboundEndpoint>

Custom polling inbound endpoint parameters

Parameter Name

Description

Required

Possible Values

Default Value

class

Name of the custom class implementation

Yes

A valid class name

n/a

You can download the maven artifact used in the sample custom polling inbound endpoint configuration above from Custom polling inbound endpoint sample.

You need to copy the built jar file to the <ESB_HOME>/repository/components/lib directory and restart the ESB to load the class.

Custom busy waiting inbound endpoint

Following is a sample custom busy waiting inbound endpoint configuration:

<inboundEndpoint xmlns="http://ws.apache.org/ns/synapse" name="custom_waiting" sequence="request" onError="fault"
	                 class="org.wso2.carbon.inbound.custom.wait.SampleWaitingClient" suspend="false">
   <parameters>
      <parameter name="sequential">true</parameter>
	  <parameter name="inbound.behavior">busy-waiting</parameter>
      <parameter name="coordination">true</parameter>
   </parameters>
</inboundEndpoint>

In addition to the parameters provided in the above sample configuration, you can provide other required parameters based on the busy waiting behaviour you need to implement.

Custom busy waiting inbound endpoint parameters

Parameter Name

Description

Required

Possible Values

Default Value

class

Name of the custom class implementation

Yes

A valid class name

n/a

sequence

 

Name of the sequence message that should be injectedYesA valid sequence namen/a
onError

 

Name of the fault sequence that should be invoked in case of failureYes

A valid fault sequence name

n/a
inbound.behavior

The behaviour of the inbound endpoint

Yes busy-waitingn/a

You can download the maven artifact used in the sample custom busy waiting inbound endpoint configuration above from Custom busy waiting inbound endpoint sample .

You need to copy the built jar file to the <ESB_HOME>/repository/components/lib directory and restart the ESB to load the class.

 

  • No labels