The Exception Listener component listens for exceptions from components running in a Fiorano network. It connects to the configured Enterprise Server and obtains details of all running Peer Servers whose names match the regular expression provided in the configuration. It then subscribes for messages on all topics, whose names match the regular expression in configuration, for each Peer Server identified. With the default values for regular expressions, the component listens for messages on topics whose names end with ON_EXCEPTION on all Peer Servers. It sends out messages received from configured topics on its output port. Messages sent out from the component have an additional string property ESBX_SYSTEM_SOURCE_TOPIC_NAME that contains the name of the topic to which the message was actually sent.

Configuration and Testing


Figure 1: Configurations of Exception Listener

Component Configuration

Attributes

Post Processing XSL Configuration

Post Processing XSL configuration can be used to transform response messages before sending it to the output port.

Icon

Refer to the Post Processing XSL Configuration section under the Common Configurations page for details regarding Pre Processing XSL configuration and Post Processing XSL configuration (below).

Error Handling Configuration

Please refer Error Handling section in Common Configurations.

Connect only to host peer server

This property determines whether the component should listen for messages only from topics on the Peer Server on which the component is running.

  • yes
    The component listens for messages only from the configured topics on the Peer Server on which this component is running. When this value is selected neither Enterprise Server connection is needed to fetch the details of Peer Servers nor the regular expression for matching the Peer Server name and hence, properties Pattern for peer server name, Server URL, Back Up Server URL, JMS User Name, JMS Password and Server Call Timeout are hidden.
  • no
    The component listens for messages from the configured topics on configured Peer Servers. When this value is selected an Enterprise Server connection to fetch the details of Peer Servers and the regular expression for filtering Peer Servers are needed and hence, properties Pattern for peer server name, Server URL, Backup Server URL, JMS User Name, JMS Password and Server Call Timeout are shown.

Pattern for peer server name

This property determines the Peer Servers from the Fiorano network that have to be monitored. The Fiorano network from which Peer Servers are filtered is determined by the Enterprise Server details provided against properties Server URL and Backup Server URL.

Click the ellipsis button to specify the pattern matching condition(s). A dialog box appears containing a table with two fields:

  • Value
    The value in this column determines whether Peer Servers whose names match regular expression defined in Name column should be monitored or not. If this column value is, ignoring case, true then the Peer Servers whose names match the regular expression is selected. If the value is false, Peer Servers whose names match the regular expression is not selected.


    Figure 2: Defining regular expression for filtering peer servers

If no patterns are defined, then no Peer Server will be selected and the component does not listen for any messages. When there are multiple pattern matches defined for each Peer Server name in Fiorano network, validation against all pattern matching conditions is performed. If even a single pattern matching condition is not satisfied, the Peer Server will not be selected.

Patterns can be loaded from a properties file using File... button. Click the following link http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#load(java.io.InputStream for details on properties file.

Example:

Figure 3: Sample pattern matching condition

Pattern matching condition in Figure 3 matches and selects all Peer Servers whose name has English alphabets only, but does not start with B.

FES Connection Configuration

Click the Ellipsis  button to set the configuration.

Server URL

The URL of Enterprise Server to which the Peer Servers that have to be monitored are connected. For more information, refer Connection to Enterprise Server section.

Back Up Server URL

The alternate URL that should be tried for connecting to the Enterprise Server if the Enterprise Server cannot be connected to using the URL mentioned against property Server URL. For more information, refer Connection to Enterprise Server section.

Icon

In case of Enterprise Servers in HA mode, this should point to Secondary Server URL if the primary is set against Server URL property and vice-versa.

JMS User Name

The user name to connect to the Enterprise Server. For more information, refer Connection to Enterprise Server  section.

JMS Password

The password to connect to the Enterprise Server. For more information, refer to Connection to Enterprise Server section.

Server Call Timeout

Sets the timeout for the calls made to the Enterprise Server.By default it is set to 180 Seconds.
This value should be increased to avoid timeout with the Enterprise server while launching Components.
For more information, refer to Connection to Enterprise Server section.

JNDI details

InitialContextFactory

InitialContextFactory implementation class name which can be used to create Initial Context that is used to lookup Peer Server's administration object. This is required to find the list of topics created on Peer Server.

Icon

This property need not be changed.

JNDI User Name

The user name required to create Initial Context for looking up objects on Peer Server. This user should be present on each of the Peer Servers and have permission to perform lookup for JMS objects.

JNDI password

The password for user provided against property JNDI User Name required to create Initial Context for looking up objects on Peer Server.

Admin Configuration

Click the ellipsis button to configure admin credentials.

Admin User Name

The user name required to create subscribers on topics on specified peer servers. This user should be present in admin user group.

Admin Password

The password for user provided against property Admin User Name required to subscribe to topics on specified peer servers.

Regex of Topic Name

This property determines the topics on Peer Servers from the Fiorano network that have to be monitored. Refer help for property Pattern for peer server name to specify pattern matching conditions for topic names.

Time Slice To Ping Peers

This property determines the time interval in milliseconds after which the component has to periodically poll for changes in Peer Servers and topics. At every poll interval, the component does the following:

  • Fetches all Peer Servers in Fiorano network or just the Peer Server on which the component is running based on property Connect only to host peer server.
  • For each Peer Server name that matches the pattern matching conditions defined, checks if the Peer Server is available in network.
    1. If the Peer Server is not available in the network but the component has created and cached a connection to the Peer Server during previous polls, then the connection is discarded.
    2. If the Peer Server is available in the network, but component has not created and cached a connection to the Peer Server during previous polls, then a new connection is made and cached.
  • For each Peer Server that is available in network and connected to the component, all the topics are listed.
  • If the topic matches the pattern matching conditions defined and is not in the list of topics to which the component subscribes, a subscription to the topic is made and a message listener is set.

Use Durable Subscriptions

Saves messages for an inactive subscriber and delivers these saved messages when the subscriber reconnects. Select the check box to create durable subscribers.

Threadpool configuration

Click the Threadpool Configuration ellipses button to configure the Threadpool Configuration properties.

Icon

Refer to the Threadpool Configuration section in the Common Configurations page for descriptions.


Connection to Enterprise Server

A connection to Enterprise Server is required only if property Connect only to host peer server is set to yes. The connection is made during the component launch using the properties Server URL, Back Up Server URL, JMS User Name,Server Call Timeout and JMS Password. If the Enterprise Server connection cannot be successfully made during the component launch, the component is automatically stopped and the error is logged in the error logs of the component.
Whenever, the component tries to check for newly added Peer Servers or topics which match configured criteria based on property Time Slice To Ping Peers it validates connection with Enterprise Server and if the connection is found invalid, it tries to reconnect using the configured Enterprise Server details.

Functional Demonstration

Scenario 1

The Regular Expression can be specified to match or differ based on the configuration. To allow topics whose name matches with the regular expression, the value column for that Regular Expression must be set as true. To allow topics whose name does not match with a regular expression, the value column for that regular expression must be set as false.
To make the exception listener listen to the error ports of all the Event Processes other than itself, the regular expression list can be specified as shown in Figure 4.


Figure 4: Configuration to listen on exception ports of only one event process

Similarly, regular expressions can be used to match the peers on which the exception listener has to subscribe to.

Example

For example, consider four event processes EP1, EP2, EP3, and EP4.

Scenario 1.1

To fetch exceptions for EP2 and EP3 (ignore exceptions for EP1 and EP4), recommended TopicRegex is:

Icon

logical operation '|' is used in regex.

Scenario 1.2

Scenario 1.1 can be performed in a different way as given below. This method is helpful when there are more number of EPs.

Ignore exceptions for EP1 and EP4 (fetch exceptions for EP2 and EP3) with TopicRegex as below:

Icon
  • First one in the above listens to all exceptions across EPs, while the second and third ones are to ignore listening.
  • logical operation '|' can be used in regex, however, expressions are separated by lines at this instance. It is better to have separate lines when there are more number of expressions.
Scenario 1.2

To fetch exceptions for EP4 (ignore exceptions for EP1, EP2 and EP3), recommended TopicRegex is:

Scenario 1.3

To fetch exceptions for EP1, EP2, EP3 ( ignore exceptions for EP4), recommended TopicRegex is

(EP1[A-Za-z0-9_]*ON_EXCEPTION|EP2[A-Za-z0-9_]*ON_EXCEPTION|EP3[A-Za-z0-9_]*ON_EXCEPTION) = true

Icon

logical operation '|' is used in regex.

Scenario 2

Configure the Exception Listener as described in Configuration and Testing section; configure a CBR with any schema. Use feeder to send an improper message to the CBR and display component to check the output message send by Exception Listener (which is picked from the exception port of CBR) on its output port.


Figure 5: Event process for scenario 2

Sample Input


Figure 6: Sample Input

Sample Output

Figure 7: Sample Output

Use Case Scenario

In a sales force integration scenario, exception listener component listens for exceptions which might occur at any step of the process.


Figure 8: Salesforce Integration scenario

The Event Process demonstrating this scenario is bundled with the installer.
Documentation of the scenario and instructions to run the flow can be found in the Help tab of flow when open in Studio.

Useful Tips

  • This component does not listen for specified topics, if the Enterprise Server is down.
  • This component listens only to topics that match the regular expression list provided in the CPS.
  • Regular expressions are case sensitive.
  • [A-Za-z0-9_]* can be used to match any valid character sequence.
  • The regular expression for a string with prefix as PREFIX is PREFIX[A-Za-z0-9_]*
  • The regular expression for a string with suffix as SUFFIX is [A-Za-z0-9_]*SUFFIX.
Adaptavist ThemeBuilder EngineAtlassian Confluence