Skip to Content

Multiple target systems in DataHub

We need to route orders to 2 different target systems (different SAP PI endpoints) based on some order attributes.

We have evaluated 2 options.

  1. Create a different feed and pool for the second system with same raw type and using event mechanism to move the raw to canonical and then to target system. For first one, we will use the default pool and feed.

  2. Pass the order related parameters which is needed for routing to raw and then canonical order. Then we are planning to override in the Outbound target OOTB code DefaultIDocTargetSystemLookupService -> lookupIDocTargetSystem() under sapidocoutboundadapter- to find the end system by reading canonical items.

Is there any other option ?

Which one is the preferred one under a clustered datahub installation ?

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 12, 2016 at 11:15 AM

    DataHub is designed to be a multi point integration tool. So the recommended approach would be to load the raw data only in one pool to DataHub and compose it to have your canonical state which then can be populated to multiple target systems.

    If you have different target systems with different target metadata you would obviously create the metadata for both target systems.

    In your case the same happens where 2 target systems are of the same type.

    In order to route some items to target system A and other (or potentially the same) to target system B it is recommended to write a custom PublicationGroupingHandler.

    This custom Handler would return true in the isApplicable() method for your order type. The group() method would return an empty list if the given canonical item parameter is not intended for the given TargetItemCreationContext otherwise a list containing the input item is returned. In this way you can publish items that are only related for a specific target system.

    For more details on PublicationGroupingHandlers see:

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Matthias,

      Thanks for your response. Let me explain in more details about the requirement.

      We have 2 SAP PI system for 2 different countries/business region. The structure of Order IDOC is different for these system (one target system takes an additional attribute than the other). So, we need to publish the Order IDOC A to SAP PI endpoint P1, and the Order IDOC B (one additional attribute for now) to SAP PI endpoint P2. FYI. we have couple of attributes in canonical order by which we can distinguish the target system. But we are not sure where to set the endpoint for target system.

  • Posted on Feb 15, 2016 at 07:55 PM

    The outboundadapter was not designed to support multiple destination. Just like all TargetSystem, only 1 user, pass, url are supported.

    I'd suggest you to replace the existing destination usage within the outboundadapter.

    Extends the class DefaultIDocSender and override the method sendIDoc.

    Call the super.sendIDoc() many times with different IDocTargetSystem.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 15, 2016 at 02:45 PM

    Hi Matthias,

    Can you please look at my comments and suggest a way to set different target system(s) for a same type like order ?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 16, 2016 at 09:59 AM

    Thanks Robin for the answer.

    I looked at the below method.

    public IDocSendingResult sendIDoc(Object iDoc, IDocTargetSystem httpDestination)

    The point is how can we distinguish the target system here. We have some attributes in the IDOC which can be used to distinguish, but how can we read those values from iDoc object ?

    Add a comment
    10|10000 characters needed characters exceeded

    • The set methods are explicitly removed from the interface as the object is intended to be immutable (not modified after creation).

      Do not re-use the provided IDocTargetSystem httpDestination object, simply re-implement the IDocTargetSystem interface to provide the value of your scenario and call the super with it.

      You do not need to do a copying and pasting the method from parent class, simply call the super method.

      For such change in the design of the adapter, you should indeed expect effort when upgrading to newer version.

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2018 at 09:50 AM


    I have almost the same requirement. In our case, there is no SAP integration, but we have CSV integration. What is best approach to process two different CSVs from the same interface. For this we also need to have two different target systems. Can we create dynamic pools, feeds and target systems? If yes, please let me know how.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.