August 15, 2023

Configuring how requests are processed – Docs for ESB 6.x

Configuring how requests are processed

  1. Double-click tMysqlInput to display
    its Basic settings view.

    use_case_tesbproviderfault_6.png

  2. Fill up the basic settings for the Mysql connection and database
    table.

    Click the […] button to open the
    schema editor.
    use_case_tesbproviderfault_7.png

  3. 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.
  4. Double-click tXMLMap to open its
    mapper.

    use_case_tesbproviderfault_8.png

  5. 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.

    use_case_tesbproviderfault_9.png

    Select the schema of the request message and click OK to validate this selection. In this
    example, the schema is getAirportInformationByISOCountryCode.
  6. Do the same to import the hierarchical schemas for the response/fault
    messages (right). In this example, these schemas are getAirportInformationByISOCountryCodeResponse and
    getAirportInformationByISOCountryCodeFault
    respectively.
  7. 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.
  8. 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.
  9. 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.
  10. 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.
    Note:

    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.

  11. 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.
  12. Double-click tESBProviderFault to
    display its Basic settings view:

    use_case_tesbproviderfault_10.png

  13. In the field Fault title, enter the
    context variable context.fault_message.

    For how to define context variables, see
    Talend Studio User Guide
    .

Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x