cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically push data hub initial configuration

phoude
Participant
0 Kudos

Hi,

for some reasons our data hub installation is losing its configuration and we have to push them again in order to make it work (SAP Integration > SAP Administration Configuration > Send to Datahub button). We have not found the reason why it is disappearing. In the meantime I was wondering if it is possible to programmatically push those configurations?

I think com.hybris.datahub.core.services.impl.DefaultDataHubOutboundService is responsible for this but I don't know how the call to sendToDataHub is placed.

Accepted Solutions (0)

Answers (1)

Answers (1)

Slava
Advisor
Advisor

Pascal,

I'm very little familiar with the SAP integration implementation, but if I'm not mistaken that configuration is pushed into a separate pool in the DataHub, where it should be present for all subsequent data processing. I think the reason it disappears is that datahub-cleanup extension is enabled and misconfigured. It cleans not only data pools but also the configuration pool. Check the datahub-cleanup related properties in the local.properties for you DH deployment.

phoude
Participant
0 Kudos

This is inside my local.properties. What could be misconfigured? Sorry, quite new to Datahub

datahub.cleanup.rawitem.enabled=true
datahub.cleanup.canonicalitem.enabled=true
datahub.cleanup.targetitem.enabled=true
datahub.cleanup.publisheditems.enabled=true
datahub.cleanup.publisheditems.excluded.types=SAPBaseStoreConfigurationMapping,SAPBaseStoreConfiguration,SAPGlobalConfiguration,SAPHTTPDestination,SAPLogicalSystem,CanonicalParty,CanonicalPartySales,CanonicalPartyRelationship,CanonicalPartyRelationshipSales<br>
Slava
Advisor
Advisor
0 Kudos

Yes, it's that datahub.cleanup.publisheditems.excluded.types that needs to be configured. It looks good, except I'm not sure what that <br> at the end is. Details can be found on this page.

If you double-check the configuration and the canonical items still disappear, then research what exactly "disappear" mean. Either examine the database or use DataHub REST API to query the items in the pool and see what's missing: are all items are gone or just some of them? What's the status of the items in the SAPCONFIGURATION pool?

If you find all items in the pool, and they all are in SUCCESS status, why do you think they disappear? Although, fixing the problem by reposting the configuration from the backoffice, probably indicates it's the correct assumption.

In that case, re-post the items again, derive all distinct item types in the configuration pool, make sure all those types are excluded from the cleanup by the property.

phoude
Participant
0 Kudos

The <br> was introduced by pasting into the comment box. It is not included in my config but good observation :). The items themselves do not disappear. It is that they will not process anymore until we push the configuration again. We have found this error in the log: com.hybris.datahub.sapidocoutboundadapter.IDocTargetSystemNotFoundException: No SAPLogicalSystem found with key 'ZPRD400' in pool=DataHubPoolEntity{id=9300, name=SAPCONFIGURATION_POOL}. If we push the configuration then this error no longer shows up. We have to manually push the datahub configuration every time the error shows up. Is it possible the configuration is gone when datahub is restarting for whatever reason?

Slava
Advisor
Advisor

Unfortunately, that exception is beyond my knowledge. It would be nice, if the team that developed/maintained that integration got involved and helped to understand what exactly that exception means.

However, I have a general idea about the process. The canonical model uses resolve() function to populate certain attributes in the canonical items during composition, by looking up referenced items in the configuration pool. That function works just fine, when the configuration is pushed fresh into the configuration pool, however, after composition or publication those items do not disappear, as you said, but become invisible. That's why I asked you to check statuses of those items after the loading and then when it stops working, because change of the item status is the most likely reason to make the items invisible.

If the team that developed that integration won't respond, I would advise studying the canonical model, especially those places where the function is used; also reading the documentation to understand how that function works; maybe experimenting in a small side project; and then debugging the problem.