Lookup Service for Sonic ESB

Posted by Admin on 07-May-2008 02:52

Lookup Service Type

This is a special servicetype designed and built to enable better and more efficient lookup functionality in Sonic ESB.

The lookup service allows the developer to quickly add call-out steps in ESB Processes. Currently, XML File based lookups and SQL Database lookups are standardly supported. Using a strategy pattern specific behavior for lookups can be custom implemented.

XML File based lookup: You can specify an XML file to perform the lookup on. You will also need to specify an XPath expression to be performed on the current XQMessage content, and an XPath expression to be performed on the external XML file. Using these expressions key values are extracted from the source message and then used to replace wildcards in the remote expression. The remote expression is then evaluated on the XML file and the results will be used to replace the original keyvalues in the message.

SQL based lookup: You can specify a jdbc.properties file which holds information on how to connect to a JDBC enabled database, provided that the JDBC driver is on the classpath. The local expression is evaluated on the XQMessage, and these keyvalues are used in a remote query on the database, the resultset will be used to replace the original keyvalues in the message.

Strategy pattern: 2 standard implemented behaviors are provided: FileLookupHandler and SQLLookupHandler. In order to implement custom behaviour you may either create a new Class that will implement the LookupHandler interface, or simply subclass the non-final FileLookupHandler or SQLLookupHandler to inherit preconfigured methods for connectivity. You may then choose to override certain methods to implement custom behavior for lookups.

Runtime params:

debug --> enable debugging info at runtime

localConfigurationFile --> properties file containing all local XPaths to be performed on source message

remoteConfigurationFile --> properties file containing all remote XPaths/Queries to be performed on external datasource (File / DB)

lookupType --> FILE or SQL

lookupSource --> location to either (FILE) XML source file or (SQL) jdbc.properties file

handlerImplClass --> Java Class for custom lookup behavior (Strategy) !! Must implement LookupHandler interface!!

dsleutjes_Sonic_LookupService.zip

All Replies

Posted by adaltas on 07-May-2008 08:51

Thank you! Your entry has been received and recorded and your rules copy moved.

This thread is closed