-
Double-click tMysqlInput to display
its Basic settings view.
-
Fill up the basic settings for the Mysql connection and database
table.
Click the [...] button to open the
schema editor.
-
Click the [+] button to add two
columns, id and name, with the type of string.
Click OK to close the editor.
Click Guess Query to retrieve the SQL
query.
-
Double-click tXMLMap to open its
mapper.
-
In the main : row1 table of the input
flow side (left), right-click the column name payload and from the contextual menu, select Import from Repository. Then the Metadata wizard is opened.
Select the schema of the request message and click OK to validate this selection. In this
example, the schema is getAirportInformationByISOCountryCode.
-
Do the same to import the hierarchical schemas for the response/fault
messages (right). In this example, these schemas are getAirportInformationByISOCountryCodeResponse and
getAirportInformationByISOCountryCodeFault
respectively.
-
Then to create the join to the lookup data, drop the CountryAbbrviation node from the main flow
onto the id column of the lookup
flow.
-
On the lookup flow table, click the wrench icon on the upper right
corner to open the setting panel.
Set Lookup Model as Reload at each row, Match Model as All
matches and Join Model
as Inner join.
-
On the airport_response output flow
table, click the wrench icon on the upper right corner to open the
setting panel.
Set the All in one option as
true. This ensures that only one
response is returned for each request if multiple airport matches are
found in the database.
-
On the fault_message output flow
table, click the wrench icon on the upper right corner to open the
setting panel.
Set the Catch Lookup Inner Join
Reject option as true to
monitor the mismatches between the country code in the request and the
records in the database table. Once such a situation occurs, a fault
message will be generated by tESBConsumer and outputted via its Row > Fault
flow.
Information noteNote:
The Row > Fault flow of tESBConsumer has a predefined schema in which the
faultString column is filled
with the content of the field Fault
title of tESBProviderFault.
-
Drop the name column in the lookup
flow onto the Expression area next to
the tns:getAirportInformationByISOCountryCodeResult node in
the airport_response output flow.
Drop the tns:CountryAbbreviation
node in the main flow onto the Expression area next to the tns:getAirportInformationByISOCountryCodeFaultString
node in the fault_message output
flow. This way, the incorrect country code in the request will be shown
in the faultDetail column of the
Row > Fault flow of tESBConsumer.
Click OK to close the editor and
validate this configuration.
-
Double-click tESBProviderFault to
display its Basic settings view:
-
In the field Fault title, enter the
context variable context.fault_message.
For how to define context variables, see
Talend Studio User Guide.