The ISB Service Connector Component is a Camel Component to easily connect to systems via Java Connectors.
The Component is particularly focused on "SQL-like" access to systems where
is to be specified. Hence, this Component might be often used in Data Extraction and Transformation use cases.
This Camel Component can be accessed via the URI
uri="isb://..."
and service of a system defined for this Component via
uri="isb://service/system/serviceName"
e.g.
uri="isb://service/omni/findPlan"
or
uri="isb://service/investone/fund/create"
in a Camel Route.
To use the ISB Service Connector Component you need to register it as a bean in your Spring Configuration.
<bean name="isb" class="com.infinity.integration.service.ServiceConnectorComponent"> </bean>
Note however, that on a Standard ISB Runtime Environment
it will already be registered by default.
The connector is configured by default to lookup for the systems defined in the configuration. however, a susbset of systems to be used can be explicitly specified.
<bean name="isb" class="com.infinity.integration.service.ServiceConnectorComponent">
<property name="systems">
<map>
<entry key="omni">
<ref bean="omniSystem" />
</entry>
</map>
</property>
</bean>
Services connected via the Service Connector Component should implement one of the following Interfaces
package com.infinity.integration.service;
public interface SimpleService
{
public Map<String, Object> doService(Map<String, Object> input);
}
public interface UpdateService
{
public Map<String, Object> doInquiryService(Map<String, Object> input);
public Map<String, Object> doUpdateService(Map<String, Object> input);
}
public interface DaoService
{
public Map<String, Object> create(Map<String, Object> input);
public Map<String, Object> read(Map<String, Object> input);
public Map<String, Object> update(Map<String, Object> input);
public Map<String, Object> delete(Map<String, Object> input);
public Map<String, Object> find(Map<String, Object> input);
}
public interface TransactionService
{
public Map<String, Object> addTransaction(Map<String, Object> input);
public Map<String, Object> removeTransaction(Map<String, Object> input);
public Map<String, Object> changeTransaction(Map<String, Object> input);
public Map<String, Object> deleteTransaction(Map<String, Object> input);
public Map<String, Object> find(Map<String, Object> input);
}
Implementations of the interfaces in com.infinity.integration.service.* can
be registered as Spring Beans like
<bean name="planOmniPlusDao" class="com.sungard.omni.PlanOmniPlusDao">
<property name="inputFields">
<map>
<entry key="name" value="planId" />
<entry key="name" value="maxRecords" />
</map>
</property>
</bean> <bean name="getParticipantBalanceBean" class="com.sungard.omni.GetParticipantBalanceBean">
<property name="inputFields">
<map>
<entry key="name" value="participantId" />
</map>
</property>
</bean>
These Spring Beans are registered in turn for invocation in Camel Routes via
<bean name="omniSystem" class="com.infinity.integration.system.System">
<property name="name" value="omni">
<property name="services">
<map>
<entry key="getPlan">
<ref bean="planOmniPlusDao"/>
</entry>
<entry key="getFields">
<ref bean="getFieldsImpl"/>
</entry>
<entry key="updateDemographicInfo">
<ref bean="updateDemographicInfo"/>
</entry>
</map>
</property>
</bean>
It is expected that the Payload to services calls is provided in a "Map/List" structure. Hence, it allows to pass Structured Data Types in Stardust directly to Camel Endpoints based on the Service Connector Component.
The top level object is expected to be an instance of Map<String, Object>.
The services underneath these Classes can then be invoked via
<to uri="isb://service/system/service"/>
e.g.
<to uri="isb://service/omni/updateDemographicInfo/add"/>
The following table lists all Service Types and the corresponding invocation patterns:
| Service Class | Invocation Pattern | Remark | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| SimpleService | isb://service/system/service | |||||||||||
| UpdateService |
|
|
||||||||||
| DaoService |
|
|
||||||||||
| TransactionService |
|
|
You could also limit the data in the return record set:
The following code invokes the service findPlans on OMNI retrieving the fields PL011, ..., PL902, even if the Service findPlans would potentially more fields.
<bean id="findPlansInputFields" class="org.springframework.beans.factory.config.MapFactoryBean">
<property name="sourceMap">
<map>
<entry key="PL011" value=""/>
<entry key="PL933" value=""/>
<entry key="PL906" value=""/>
<entry key="PL091" value=""/>
<entry key="PL951" value=""/>
<entry key="PL902" value=""/>
</map>
</property>
</bean>
<camelContext trace="true" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="..." />
<setHeader headerName="returnFields">
<simple>ref:findPlansInputFields</simple>
</setHeader>
<to uri="isb://service/omni/findPlans"/>
</route>
</camelContext>